kalster Posted October 14, 2012 Share Posted October 14, 2012 (edited) i am using localhost to get emails from php. for some strange reason the odd email does not go through. i would said i get about 90% of emails from localhost. here is my code for the php email function. why is some emails not going through? i am using current xampp and current php. in the code below, when the email does not go through, i am not getting the php die message. for the email sending program, i am using mercury/32 $to = "root@localhost"; $subject = "test"; $message = "<html><body>test</body></html>"; $from = "localhost"; $headers = "From: $from\r\n"; $headers .= "Content-type: text/html\r\n"; mail($to,$subject,$message,$headers) or die("error: mail not sent"); Edited October 14, 2012 by kalster Quote Link to comment https://forums.phpfreaks.com/topic/269443-not-getting-a-few-emails-with-php-email-function/ Share on other sites More sharing options...
Christian F. Posted October 14, 2012 Share Posted October 14, 2012 Check the logs for your e-mail server, should tell you why. Quote Link to comment https://forums.phpfreaks.com/topic/269443-not-getting-a-few-emails-with-php-email-function/#findComment-1385111 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.