SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    PHP Otaku Gibb's Avatar
    Join Date
    Jul 2004
    Location
    Texas
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Nothing happens when attemping mail()

    Howdy all, I'm trying to determine why my forgot password script doesnt do anything when i'm trying to send the email.

    PHP Code:
    mail ($email'Subject Line'$body'From: webmaster@example.com'); 
    I get no errors returned at all, and everything seems to have ran ok (my echo's all show valid data before i use the mail function), but no email ever gets sent.

    Everything seems fine in my servers PHP settings
    Quote Originally Posted by phpinfo
    sendmail_from me@localhost.com
    sendmail_path /usr/sbin/sendmail -t -i
    SMTP localhost
    smtp_port 25
    The sendmail function is located there, cause i've checked that to be sure.

    Anybody have any idea what could cause this?
    Last edited by Gibb; Nov 23, 2004 at 16:31.

  2. #2
    SitePoint Zealot
    Join Date
    Aug 2004
    Location
    Madison, WI
    Posts
    191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    have whoever you are sending the e-mail to check their junk e-mail folders...oftentimes when the proper headers aren't sent (as in this case) there's a strong chance that the e-mail will get treated as spam

    also, to make sure that the function is working you can try
    PHP Code:
    if (mail($email'Subject Line'$body'From: webmaster@example.com')) {
       echo 
    'Mail sent!';
    }
    else {
       echo 
    'There was an error while sending the e-mail.';


  3. #3
    PHP Otaku Gibb's Avatar
    Join Date
    Jul 2004
    Location
    Texas
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've tried code such as what you posted and the 'Mail sent!' message is displayed. I've also talked to the company IT guy and he says that no emails were treated as spam for the entire day.

    Is there any way to grab errors from the sendmail program? PHP is not seeing anything so i dont think there are any problems with the php code.

  4. #4
    $this->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Dec 2003
    Location
    Federal Way, Washington (USA)
    Posts
    1,524
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try sending the mail to yourself to verify that it works. Also, have a look at the php.net documentation. Perhaps you'll find something there which will help.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    Showcase your music collection on the Web

  5. #5
    PHP Otaku Gibb's Avatar
    Join Date
    Jul 2004
    Location
    Texas
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yay! ok It wont send to my company's email, or my website's email (both never show up) but it worked for my gmail account.

    My company does have a spam catching thing, but the IT guy said he didnt find any emails like i described. My website's email has absolutely no spam protection so i dont know what could cause that.

    Judging from this post in the PHP Manual section for Mail:
    Code:
    nes at techie dot com
    26-Sep-2003 10:36 
    I've noticed some anti-spam email programs also deny delivery to mail that doesn't have a Message-ID.  Even though it is legal to do so, many domains will consider the email spam and drop it.  
    
    Using sendmail on a win2k server, there is no Message-ID on some test mailings I've done.  The ones that are added were there due to the filtering software added it afterwards, at least that's what the spamheaders error code database says.
    this sounds like it could possibly be my problem, but i havent seen anybody having this problem on sitepoint.

    Anybody know what else could be wrong, or how i could add a message-id to my emails?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •