Help with PHP mail() function

Discussion in 'PHP' started by liam1412, Oct 2, 2007.

  1. #1
    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"); 
    
    PHP:
     
    liam1412, Oct 2, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    nico_swd, Oct 2, 2007 IP
  3. jmhyer123

    jmhyer123 Peon

    Messages:
    542
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yeah, lol, or try putting each section (email, message, subject, etc.) into a variable and then inserting it into the mail() function.
     
    jmhyer123, Oct 2, 2007 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    ^^ Makes no difference.
     
    nico_swd, Oct 2, 2007 IP
  5. kendo1979

    kendo1979 Peon

    Messages:
    208
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    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.
     
    kendo1979, Oct 2, 2007 IP
  6. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #6
    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.
     
    nico_swd, Oct 3, 2007 IP