vividona Posted August 4, 2011 Share Posted August 4, 2011 I don't know why refuse to send email $to = "To: ".$em.""; $subject = $txt3; $message = "".$txt4.""; $headers = "From:".$txt2." <".$txt2.">" . "\r\n" . "Reply-To: ".$txt2." <".$txt2.">" . "\r\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-Type: text/html; charset=utf-8\n"; $headers .= "\r\nX-Mailer: PHP/" . phpversion(); $headers .= "X-Mailer: PHP/" . phpversion()."\r\n"; mail($to, $subject, $message, $headers); Quote Link to comment Share on other sites More sharing options...
WebStyles Posted August 4, 2011 Share Posted August 4, 2011 $to = $em; Quote Link to comment Share on other sites More sharing options...
AyKay47 Posted August 4, 2011 Share Posted August 4, 2011 1. what errors do you receive? 2. some of your syntax is incorrect for doumentation on the mail function Quote Link to comment Share on other sites More sharing options...
vividona Posted August 4, 2011 Author Share Posted August 4, 2011 $to = $em; I changed it like this $to = $em; $subject = $txt3; $message = "".$txt4.""; $headers = "From:".$txt2." <".$txt2.">" . "\r\n" . "Reply-To: ".$txt2." <".$txt2.">" . "\r\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-Type: text/html; charset=utf-8\n"; $headers .= "\r\nX-Mailer: PHP/" . phpversion(); $headers .= "X-Mailer: PHP/" . phpversion()."\r\n"; mail($to, $subject, $message, $headers); $em is my email which I fetch it from database. Quote Link to comment Share on other sites More sharing options...
vividona Posted August 4, 2011 Author Share Posted August 4, 2011 1. what errors do you receive? 2. some of your syntax is incorrect for doumentation on the mail function No error which one that is incorrect? Quote Link to comment Share on other sites More sharing options...
AyKay47 Posted August 4, 2011 Share Posted August 4, 2011 1. what errors do you receive? 2. some of your syntax is incorrect for doumentation on the mail function No error which one that is incorrect? if the mail function is not working, it will output errors to the error.log, do you have error_reporting set to E_ALL? ini_set("error_reporting",E_ALL); Quote Link to comment Share on other sites More sharing options...
vividona Posted August 4, 2011 Author Share Posted August 4, 2011 the function if working and I have no error but I did not catch any email I tried gmail - yahoo - hotmail Quote Link to comment Share on other sites More sharing options...
WebStyles Posted August 4, 2011 Share Posted August 4, 2011 your code works for me (replacing all addresses, of course). Check your spam box. echo all variables and check their values. Quote Link to comment Share on other sites More sharing options...
AyKay47 Posted August 4, 2011 Share Posted August 4, 2011 the function if working and I have no error but I did not catch any email I tried gmail - yahoo - hotmail if its working then it is either sending to the wrong email or going into the junk/spam folder..as Webstyles said previously Quote Link to comment Share on other sites More sharing options...
vividona Posted August 4, 2011 Author Share Posted August 4, 2011 WebStyles & AyKay47 Thank you I think I put the wrong email. Now it is working but in message body It show this : X-Mailer: PHP/5.2.17X-Mailer: PHP/5.2.17 how can I hide this Quote Link to comment Share on other sites More sharing options...
AyKay47 Posted August 4, 2011 Share Posted August 4, 2011 remove it from your script.. Quote Link to comment Share on other sites More sharing options...
WebStyles Posted August 4, 2011 Share Posted August 4, 2011 remove it from your script.. Yeah! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.