I used simple php email function but it send an email in junk folder or spam.

Discussion in 'PHP' started by jsshanthi, Sep 13, 2010.

  1. #1
    Hello all,
    I used simple php email function but it send an email in junk folder or spam.
    Can anyone tell me why is this so?

    Her is the code:

    $host = "ssl://smtp.gmail.com";
    $port = "465";


    $to = " xx@gmail.com"; // note the comma



    $subject = " $_POST[company_website] ";
    $headers = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $headers .= 'From: About Wholesale Account' . "<$_POST>\r\n";$headers .= 'Cc:
     
    jsshanthi, Sep 13, 2010 IP
  2. HungryMinds

    HungryMinds Active Member

    Messages:
    216
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    63
    #2
    Hi!

    Try 2 Use Your Domain Email Address In "From: ".

    e.g: your domain is "mywebsite.com"
    So U'll Have To Use "From: ";
    And Don't Use "@gmail" etc etc etc
    But U Can Redirect Emails To Your Account.
     
    HungryMinds, Sep 13, 2010 IP
  3. lowridertj

    lowridertj Well-Known Member

    Messages:
    2,882
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    195
    #3
    lowridertj, Sep 13, 2010 IP
  4. jsshanthi

    jsshanthi Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hi
    I have used our company domain itself in the from address instead of gmail.com
    I have used 2 mail function one for sending form details
    and other for sending thank you to the person who submitted the form
    The problem i am getting here is Thank you mail is going into spam and the form detials are going into inbox
    Here is the code I have used for sending thank you mail
    $to1 = "$_POST
     
    jsshanthi, Sep 13, 2010 IP