Unsecured Loans - Magazine Subscriptions - Mortgages - Credit Card - Hosting web

PDA

View Full Version : Help with PHP mail() function


liam1412
Oct 2nd 2007, 5:32 pm
Hi

I am working on a site for a client in the US. I have a simple mail(); query that sends out the activation e-mail. When she signs up in the US it works fine but I have tried my btinternet, hotmail and my work account and it doesn't work here. What is that about then??

Here is the mail() request.


$sendmail = mail($email, 'Promoteproxy.com - Helpdesk Request', 'You have recieved the following helpdesk query<br /><br /><b>Name</b> - '.$name.'<br /><br /><b>Email Addy</b> - '.$useremail.'<br /><br ><b>Subject</b> - '.$subject.'<br /><br /><b>Query</b><br /><br />'.$query.'<br /><br />Thanks', "From: noreply@promoteproxy.com <noreply@promoteproxy.com>\n" . "MIME-Version: 1.0\n" . "Content-type: text/html; charset=iso-8859-1");

nico_swd
Oct 2nd 2007, 5:34 pm
Use phpMailer (http://phpmailer.sourceforge.net).

jmhyer123
Oct 2nd 2007, 5:40 pm
Yeah, lol, or try putting each section (email, message, subject, etc.) into a variable and then inserting it into the mail() function.

nico_swd
Oct 2nd 2007, 5:46 pm
^^ Makes no difference.

kendo1979
Oct 2nd 2007, 9:46 pm
firstly, check whether your sendmail binary is located correctly on your php.ini.

then do as jmhyer123 says. then you might wanna use single quote `'` instead of `"` on the additional header setting.

nico_swd
Oct 3rd 2007, 5:22 am
The quotes are not the problem either, the problem lays in the headers. Hotmail moves all mails that don't have certain headers into the junk section.

All providers have a different way of handling the mails and headers, that's why I suggest using phpmailer since it covers everything, and it's the best and easiest method to send mails successfully.