Jump to content

mail() works inconsistantly


mo

Recommended Posts

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.";

}

 

Link to comment
https://forums.phpfreaks.com/topic/145625-mail-works-inconsistantly/
Share on other sites

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/

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.