mo Posted February 17, 2009 Share Posted February 17, 2009 I wrote a test email script that uses the mail() function. Sometimes the mail goes through right away and other times it takes hours. Is there another more reliable PHP email option? Example: $mail_headers = "MIME-Version: 1.0" . "\r\n"; $mail_headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; $mail_headers .= "From: ".$store_name." <".$webmaster.">\r\n"; $subj = "test email"; if(mail($_POST('email'), $subj, $mail_body, $mail_headers)){ $message2 = "<h3>Thank You!</h3>\n\n You have been registered and are now ready to log in and place an order."; }else{ $message2 = "Registration un-successfull. Error during email send. Please contact $webmaster."; } Quote Link to comment https://forums.phpfreaks.com/topic/145625-mail-works-inconsistantly/ Share on other sites More sharing options...
drisate Posted February 17, 2009 Share Posted February 17, 2009 mo taht depens on your server not your script ;-) You could try using and outgoing pop server ... Quote Link to comment https://forums.phpfreaks.com/topic/145625-mail-works-inconsistantly/#findComment-764525 Share on other sites More sharing options...
allworknoplay Posted February 17, 2009 Share Posted February 17, 2009 mo taht depens on your server not your script ;-) You could try using and outgoing pop server ... Agreed, this is more of an ISP issue if you are hosting your site at an ISP, and then there's always the MX records and rDNS issues.... Quote Link to comment https://forums.phpfreaks.com/topic/145625-mail-works-inconsistantly/#findComment-764527 Share on other sites More sharing options...
mo Posted February 17, 2009 Author Share Posted February 17, 2009 Thanks, I assumed this but thought there might be another mail function that I could use. I will talke to my host support. Quote Link to comment https://forums.phpfreaks.com/topic/145625-mail-works-inconsistantly/#findComment-764530 Share on other sites More sharing options...
drisate Posted February 17, 2009 Share Posted February 17, 2009 mo taht depens on your server not your script ;-) You could try using and outgoing pop server ... Agreed, this is more of an ISP issue if you are hosting your site at an ISP, and then there's always the MX records and rDNS issues.... This looks more like a mail q problem. You probably hosted on a shared server and a lot of the website you're sharing with sends out emails so it builds up in the IMAP server and thats why sometimes it's faster then other times. Check this out http://www.activexperts.com/ActivEmail/howto/php/ Quote Link to comment https://forums.phpfreaks.com/topic/145625-mail-works-inconsistantly/#findComment-764532 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.