email - PHP mail function is not working on my server? -


My mail function is on the online server. It was working fine but not yet. I'm confused why he has stopped sending mail. This message has been sent that an email has been sent, but no email has been received in the Inbox.

My PHP code is:

  & lt ;? Php if (isset ($ _ POST ['submit'])) {$ name = $ _POST ['name']; $ Email = $ _POST ['email']; $ Phone = $ _POST ['phone']; $ Message = $ _POST ['message']; $ Headers = "From:" $ Email "\ N"; // address = "$" from $; // my mail id $ header = "MIME-Version: 1.0 \ n"; $ Headers = "Content-type: text / html; charset = iso-8859-1 \ n"; $ Theme = "test mail"; $ Body = '& lt; Html & gt; & Lt; Top & gt; & Lt; Meta http-equiv = "content-type" content = "text / html; charset = utf-8" /> & Lt; Title & gt; "." & Lt; H3 & gt; "Hello Test," & Lt; / H3 & gt; ". / Lt; / title> gt; & gt; & gt; Body & gt; & lt; p & gt; & lt; / p & gt; & lt; p style =" color: # 00CC66; Font-weight: 600; Font-style: italic; Font-size: 14px; Float: left; Margin-left: 7px; "& gt; You have received an inquiry from your website. Please review the contact information below. & Lt; / p & gt; '; if (mail ($ $, $ theme, $ body , $ Headers)) {? & Gt; & lt; h3 style = "color: # d96922; Font-weight: bold; Height: 0 pixels; Margin-top: 1px; "& gt; Thank you for contacting us !!  <> Php} Other {print_r (error_get_last ()}}}  < / Pre> 

What's wrong with this? Please help me find the solution and also help me to reshape the error?

I try this, each line is \ r \ n and on header (this may seem unnecessarily ) Additionally, in the header, charset = utf-8 d It should be sufficient, although not, though, make sure that it matches. (There are currently no mismatch).

  ; if (! Mail ($ to_email, $ theme, $ message, $ header)) {print_r (error_get_last ());} and {? & Gt; & lt; h3 style = "color: # D96922; Font-weight: bold; Height: 0 pixels; Margin-top: 1px; "& gt; Thank you for contacting us !!    

I To avoid notices / errors, I will replace the first line with something like this:

  if ($ _POST & amp; $ _POST ['submit']) & amp; ($ _ POST ['name']) and isset ($ _ POST ['email']) & amp; empty! ($ _ POST ['name']) & Amp; Empty! ($ _ POST [ 'Email'])) {   

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -