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
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/

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.