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); Link to comment https://forums.phpfreaks.com/topic/243817-email-function/ Share on other sites More sharing options...
WebStyles Posted August 4, 2011 Share Posted August 4, 2011 $to = $em; Link to comment https://forums.phpfreaks.com/topic/243817-email-function/#findComment-1251833 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 Link to comment https://forums.phpfreaks.com/topic/243817-email-function/#findComment-1251834 Share on other sites More sharing options...
vividona Posted August 4, 2011 Author Share Posted August 4, 2011 Quote $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. Link to comment https://forums.phpfreaks.com/topic/243817-email-function/#findComment-1251862 Share on other sites More sharing options...
vividona Posted August 4, 2011 Author Share Posted August 4, 2011 Quote 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? Link to comment https://forums.phpfreaks.com/topic/243817-email-function/#findComment-1251866 Share on other sites More sharing options...
AyKay47 Posted August 4, 2011 Share Posted August 4, 2011 Quote Quote 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); Link to comment https://forums.phpfreaks.com/topic/243817-email-function/#findComment-1251878 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 Link to comment https://forums.phpfreaks.com/topic/243817-email-function/#findComment-1251886 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. Link to comment https://forums.phpfreaks.com/topic/243817-email-function/#findComment-1251890 Share on other sites More sharing options...
AyKay47 Posted August 4, 2011 Share Posted August 4, 2011 Quote 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 Link to comment https://forums.phpfreaks.com/topic/243817-email-function/#findComment-1251893 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 Link to comment https://forums.phpfreaks.com/topic/243817-email-function/#findComment-1251902 Share on other sites More sharing options...
AyKay47 Posted August 4, 2011 Share Posted August 4, 2011 remove it from your script.. Link to comment https://forums.phpfreaks.com/topic/243817-email-function/#findComment-1251914 Share on other sites More sharing options...
WebStyles Posted August 4, 2011 Share Posted August 4, 2011 Quote remove it from your script.. Yeah! Link to comment https://forums.phpfreaks.com/topic/243817-email-function/#findComment-1251919 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.