Problem with mail()

Discussion in 'PHP' started by crazyryan, Sep 22, 2007.

  1. #1
    I'm not sure if this is my server or not but I'm not recieving mail with this:

    
    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    
    // Mail it
    $youremail = "email@email.com";
    $subject = "Contact Form Inquiry";
    
    mail($youremail, $subject, $message, $headers);
    echo "Emailed";
    PHP:
    Server problem or code problem?

    EDIT: Tested it with gmail and the email sent through fine, but it isnt for windows live(hotmail).
     
    crazyryan, Sep 22, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    What output does this give you?

    
    echo mail($youremail, $subject, $message, $headers)
        ? 'Sent'
        : 'Error';
    
    PHP:
    And try using a different email address to see if your provider blocks it.
     
    nico_swd, Sep 22, 2007 IP
  3. crazyryan

    crazyryan Well-Known Member

    Messages:
    3,087
    Likes Received:
    165
    Best Answers:
    0
    Trophy Points:
    175
    #3
    That shows sent .. I've only tested it on gmail and hotmail and it works fine with gmail.
     
    crazyryan, Sep 22, 2007 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    nico_swd, Sep 22, 2007 IP