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 always in Hotmail Junk Folder - help!

Discussion in 'PHP' started by CCD, Oct 16, 2006.

  1. #1
    Hi,

    There must be some way to get php mail into the inbox of hotmail accounts, since so much spam manages to get there?

    So are there any kind hearted spammers or php mail gurus on DP that can show me how to get my server generated mail into people's inbox rather than their junk folder?

    The mails are a response to a registration form, so its for a legitimate purpose.

    Thx.
     
    CCD, Oct 16, 2006 IP
  2. penagate

    penagate Guest

    Messages:
    277
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #2
    As far as I remember you need full message headers (From, etc.) otherwise Hotmail flags it as spam.
     
    penagate, Oct 16, 2006 IP
  3. kemus

    kemus Guest

    Messages:
    487
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #3
    And if you are on shared hosting, it might be that there's a blacklisted spammer on your ip...
     
    kemus, Oct 17, 2006 IP
  4. dwphost

    dwphost Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Try Other Script, might work.
     
    dwphost, Oct 17, 2006 IP
  5. clancey

    clancey Peon

    Messages:
    1,099
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    0
    #5
    My son has a Hotmail account and he uses whitelists. Everything and everyone else goes into his junk folder. The only way you can change that is to get him to whitelist you when he joins your website. I do not know if Hotmail accounts now have these settings turned on by default. But, I am sure most users turn them on because of ongoing problems with dictionary-style spamming.

    For those people who do not have this feature turned on, you will need to look very closely at your email messages to see if they are "spammy". If you are simply confirming that someone joined your site, you should rarely have a problem. But, if you are doing any kind of follow up marketing or site hyping, you could be triggering spam rules.
     
    clancey, Oct 17, 2006 IP
  6. streety

    streety Peon

    Messages:
    321
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I've just checked you're site in an online rbl site and it isn't coming up as a problem. Having said that it is possible that hotmail has their own custom list.

    The best suggestion I can probably make is to try a different way of sending your emails. For example phpmailer or Swift Mailer.
     
    streety, Oct 17, 2006 IP
  7. CCD

    CCD Peon

    Messages:
    330
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Thanks for the replies, I've tried many of the suggestions but not solved the issue yet, though an SPF record may help (conflicting reports on the web as to whether it will).

    Seems hotmail just really dislikes manufactured mail, even when its purpose is valid.

    I haven't tried phpmailer or swift yet, will try them.

    Any further tips greatly appreciated :)
     
    CCD, Oct 18, 2006 IP
  8. Fl1p

    Fl1p Active Member

    Messages:
    511
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    58
    #8
    Is your header complete? You should display all the information below on your header.

    $headers = "MIME-Version: 1.0\n";
    $headers .= "Content-type: text/plain; charset=iso-8859-1\n";
    $headers .= "From: aaa.bbb <aaa@bbb.ccc>\n";
    $headers .= "X-Mailer: PHP's mail() Function\n";
    mail("aaa@bbb.ccc", "subject","message",$headers);
     
    Fl1p, Oct 18, 2006 IP
  9. globalcashsite

    globalcashsite Peon

    Messages:
    806
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I have same command will little change, does this matter? I have "X-Mailer: PHP 4\r\n"?

    GCS
     
    globalcashsite, Jan 17, 2010 IP
  10. TimothyJohn

    TimothyJohn Member

    Messages:
    786
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    35
    #10
    If you are on free hosting and your domain is elongated even if it's covered by a co.cc it will usually be flagged as spam. The other factor you must consider as other members have already stated it the headers. Hotmail and other email service providers assume that if the headers are incorrect then the site must not be run by a professional and is more then like a spammer. Try to adjust your headers to match the standard and I think you will find you no longer have any issues :)
     
    TimothyJohn, Jan 28, 2010 IP
  11. lcamilo

    lcamilo Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    For some reason when you use boundary is working. Use the following code and you'll have your emaisl being sent and not marked as spam or junk. Make sure you change the appropriate values.


    $boundary = uniqid('np');


    $headers = "MIME-Version: 1.0\r\n";
    $headers .= "From: Foo <foo@bar.com>\r\n";
    $headers .= "Subject: Test mail\r\n";
    $headers .= "Content-Type: multipart/alternative;boundary=" . $boundary . "\r\n";


    $message = "This is a MIME encoded message.";

    $message .= "\r\n\r\n--" . $boundary . "\r\n";
    $message .= "Content-type: text/plain;charset=utf-8\r\n\r\n";
    $message .= "This is the text/plain version.";

    $message .= "\r\n\r\n--" . $boundary . "\r\n";
    $message .= "Content-type: text/html;charset=utf-8\r\n\r\n";
    $message .= "This is the <b>text/html</b> version.";

    $message .= "\r\n\r\n--" . $boundary . "--";

    Got it from http://krijnhoetmer.nl/stuff/php/html-plain-text-mail/
     
    lcamilo, Jun 7, 2010 IP
  12. gardouth

    gardouth Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    This seems to be correct and solved my problem however I don't think you need the 'Subject:' line in the headers. If you include this AND the subject in the second paramiter for mail() then spam filters will see it as having multiple subjects (which scores quite high on spam filters). I just removed the subject line and only used the one in mail() and it works fine.

    Another problem I had with spam was with reverse DNS. I use a vertual server and for each domain on it, I had to set up a rDNS record with only my hosting provider can do for me despite having full DNS control on my server. rDNS doesn't score very highly on the spam filter but its one more thing that will help.
     
    gardouth, Sep 8, 2011 IP