Results 1 to 3 of 3

Thread: php mail() sending mails to spam folder

  1. #1
    Join Date
    Nov 2010
    Posts
    115
    Thanks
    27
    Thanked 0 Times in 0 Posts

    Default php mail() sending mails to spam folder

    Hi All,

    Iam sending mails from PHP and they are going straight to SPAM folder.How to avoid these and make them to my inbox. this is my code

    <?php
    $To="ssssssss@gmail.com";

    $Subject="U WON 10 crore";

    $headers = "From: sss@gmail.com";
    $Body="see this image";

    if(mail($To,$Subject,$Body,$headers))

    {

    echo "SUCCESS";

    echo ("<a href='$url'\">Back to Website</a>");
    }
    else
    {

    echo"message sending failed";

    }

    ?>

  2. #2
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default

    This is a tricky subject, as different mail services have different ways of detecting spam (some are more strict than others).

    The fact that the message subject is "U WON 10 crore" makes it look instantly dodgy... you've got to try and make an effort to make the email seem trustworthy.

    The message body is also only 3 words, making it look even more suspicious to spam filters. You need to bulk up the message, correct the grammar and try again. Even then, there's no sure way of making your emails not go into the spam folder.

  3. #3
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    add to the headers: only "From" is required, but add a "reply-to," at least. Put more into the body of the message, as Schmoopy says.

    ultimately, however, the only way to be sure it won't go to the spam folder is to have the recipient add the "from" address to their contacts / "trusted" list. good luck with that

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
  •