SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy mail() and hotmail filter

    Hi, I'm trying to use a simple mailing list script that uses mail() to send out emails to a list. Everything seems to be working perfectly, but I have a problem with Hotmail and their junk mail box. Currently, I've tested it with a POP3 account, my hotmail account, and another webmail account. I have no problems sending the emails off to my other accounts, but hotmail always receives the email directly into their junk mail box. Also, when I put HTML into the message, not only is it moved to the junk mail box right away, the HTML isn't even included in the email. Here are the headers I'm using for the emails:
    Code:
    $mailheaders = "From: $lettername\n";
    $mailheaders .= "Reply-To:$youremail\n";
    $mailheaders .= "MIME-Version: 1.0\n"; 
    $mailheaders .= "Content-type: text/html; charset=iso-8859-1\n"; 
    $mailheaders .= "X-Priority: 3\n"; 
    $mailheaders .= "X-MSMail-Priority: Normal\n"; 
    $mailheaders .= "X-Mailer: Gak Server";
    Any idea why my mail isn't going through properly? My boss keeps pushing me to get this done as soon as possible, yet I can't seem to get around this otherwise simple task.

  2. #2
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try using \r\n instead of just \n

  3. #3
    SitePoint Member
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've tried that with no success.

    Is it even my headers that are the problem or is this something common with mail() and the Hotmail spam filter?

  4. #4
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well Hotmail is notorious for being icky about emails.
    I'd start off with a basic email with no extra headers then add them in one by one and see which one (if any) triggers Hotmail's spam filter.

  5. #5
    SitePoint Member
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just haven't seem to get to the bottom of this. When I try without headers, hotmail doesn't even receive the email at all, not even in the junk mailbox. Perhaps it could be the mail script itself. I'm using a simple mailing list script called Easy Letter. I got it from the below address:

    http://www.onlinetools.org/tools/easyletter.php

    Should I abandon PHP, and look into a Perl mailing list script? I've tried a couple with a few problems, which is why I originally decided to move to PHP instead. Damn this NT server I'm on!

  6. #6
    SitePoint Addict
    Join Date
    Apr 2003
    Posts
    332
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    def,

    Add this to the headers:

    "Return-Path: <andyw@abcd.org>"

    Works for me.

    Andy

  7. #7
    SitePoint Enthusiast Bobbi's Avatar
    Join Date
    Mar 2005
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you want to send mails with PHP, using mail(); is the worst thing you can do ... pretend you never saw that this function even exists and use PHPMailer (http://phpmailer.sourceforge.net/), which is a lot more powerful, helps you to include the hundreds of headers required to get past the spam filters these days, and has many more options available than you'll ever fit into mail();

    Regards,

    Bobbi

  8. #8
    SitePoint Member
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I gave it a try Andy, but adding the "Return-Path" didn't help much for me.

    I think I'll take Bobbi's advice and forget about the mail() function completely. It's been causing me enough stress, so to hell with it. PHPMailer, here I come!


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
  •