1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

PHP mail function reporting mail sent but mail never received

Discussion in 'PHP' started by clem_c_rock, Nov 13, 2008.

  1. #1
    Hello,

    I have a script that suddenly stopped working and nothing's been changed. I am using the php mail() function to send a simple email form and the mail() function report true when it is fired off but I can never receive the emails.

    I suspect something's changed in our hosting but wanted to rule everything out before I started investigating there.

    Here's the simple code I am using:


    
    	  $send_tenant_mail = mail( $tenant_email, $subject, $body_header, "From: $from\nReply-To: $from\n" );
              if($send_tenant_mail == 1)
    	  { 
    	      $confirm = "A Confirmation Email has been sent to: $tenant_email";
    	  }
    
    Code (markup):

    Thanks,
    Clem C
     
    clem_c_rock, Nov 13, 2008 IP
  2. rene7705

    rene7705 Peon

    Messages:
    233
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    check your mail server's logs, your mailserver is running and accepting mails but cannot deliver them to the network for some reason..
     
    rene7705, Nov 13, 2008 IP
  3. crivion

    crivion Notable Member

    Messages:
    1,669
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    210
    Digital Goods:
    3
    #3
    you might check your spam mail folder
    also you can use phpMailer which is actually better
    . pm me if you need paid help .
     
    crivion, Nov 13, 2008 IP
  4. acakadut

    acakadut Peon

    Messages:
    194
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    use smtp to send mail instead of mail()
    check out phpmailer with smtp
     
    acakadut, Nov 16, 2008 IP
  5. Zeras

    Zeras Guest

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Another thing to check is that your upstream internet provider (or hosting company) may be either blocking SMTP (port 25) or now require a username/password to relay your mail.

    -Zeras
     
    Zeras, Nov 16, 2008 IP
  6. wajid_pk

    wajid_pk Peon

    Messages:
    334
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #6
    show the complete script
    did you included mime version in case if sending html or defined char set
    
    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    
    PHP:
     
    wajid_pk, Sep 12, 2009 IP