SitePoint Sponsor

User Tag List

Results 1 to 14 of 14
  1. #1
    Who is Mr Blonde? Mr Blonde's Avatar
    Join Date
    Sep 2006
    Location
    Gold Coast, QLD
    Posts
    359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    email from forms recognised as junk

    yo!

    i use a simple mail function for enquiry forms that send me an email once the user has filled it in. I have just been told by a client that when I reply to the email it goes straight to their junk mail folder, and after some brief testing i found they are right and I cant believe i didn't notice it earlier. Is there anything i have to add to make hotmail see it as legit and not started by a script? I've posted my php below.. any help would be much appreciated.
    PHP Code:
    <?
      $email 
    $_REQUEST['email'] ;
      
    $name $_REQUEST['name'] ;
      
    $message $_REQUEST['message'] ;

      if (empty(
    $email)) {
        
    header"Location: http://www.example.com./error.php" );
      }
      else {
        
    mail"name@example.com""General Enquiry""
        
    $name
        
    $email
        
        
    $message""From: $email);
        
    header"Location: http://www.example.com/message-sent.php" );
      }
    ?>
    thanks
    Heavens Rejects : Online Clothing Store
    Alternative Clothing : Mr Blonde
    Front end development : By the Webfella

  2. #2
    SitePoint Evangelist superuser2's Avatar
    Join Date
    Aug 2006
    Posts
    598
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Check the internet, make sure your domain isn't blacklisted. Try sending an email to the client from a regular email address @ your domain through an email client. Does that go to a spam filter?

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2005
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    IIRC the structure or non-inclusion of certain details in headers can cause a mail to be seen as spam by some providers.

    I have read an article on the matter, but dammed if I can find it again.

    edit: or it could simply be what superuser2 says

  4. #4
    SitePoint Evangelist superuser2's Avatar
    Join Date
    Aug 2006
    Posts
    598
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Angrycat
    IIRC the structure or non-inclusion of certain details in headers can cause a mail to be seen as spam by some providers.
    That's likely too, but most PHP programmers don't include more than "From: noreply@domain.com". If you're client's email uses standard filtering, I think we'd here about it more.

  5. #5
    Who is Mr Blonde? Mr Blonde's Avatar
    Join Date
    Sep 2006
    Location
    Gold Coast, QLD
    Posts
    359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah i know 100% im definitely not blacklisted. im pretty sure it's sumthin to do with me not including something in the header like angrycat mentioned... but as i only dabble in php occasionally i don't know of any extra things i can add to it to make it work. anyone else have any suggestions?
    Heavens Rejects : Online Clothing Store
    Alternative Clothing : Mr Blonde
    Front end development : By the Webfella

  6. #6
    SitePoint Evangelist superuser2's Avatar
    Join Date
    Aug 2006
    Posts
    598
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wait a minute. You saw that when you reply to the email it goes to client's spam folder. Where does the email go when the contact for sends it? Does it go to a spam folder, too?

  7. #7
    Who is Mr Blonde? Mr Blonde's Avatar
    Join Date
    Sep 2006
    Location
    Gold Coast, QLD
    Posts
    359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I use outlook express so it comes through fine. I just tested then it in hotmail and gmail, and gmail is fine but hotmail is sending it straight to the junk pile.
    Heavens Rejects : Online Clothing Store
    Alternative Clothing : Mr Blonde
    Front end development : By the Webfella

  8. #8
    SitePoint Member
    Join Date
    Mar 2007
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I wonder if you change some of the variable names will it still be considered spam? Such as who the email is from .....what if you made it a valid hotmail email address? Also change the subject to see if that is getting it.

  9. #9
    Who is Mr Blonde? Mr Blonde's Avatar
    Join Date
    Sep 2006
    Location
    Gold Coast, QLD
    Posts
    359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by DotHQ View Post
    I wonder if you change some of the variable names will it still be considered spam? Such as who the email is from .....what if you made it a valid hotmail email address?
    The $email variable is what the user types into the email address field so i can't determine that. Ive tried changing the subject too to something less broad but still on effect
    Heavens Rejects : Online Clothing Store
    Alternative Clothing : Mr Blonde
    Front end development : By the Webfella

  10. #10
    SitePoint Enthusiast
    Join Date
    Mar 2007
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok i had a problem like this in the past with my own server. The hotmail, msn, and yahoo accounts do NOT check if the originating IP is registered to the specified domain that the email is coming from. I had a problem with aol and aim due to the fact that aim and aol checks for the records as to if the originating IP is the actually IP that the from email address if register to. The problem you are having is due the the fact you are not specifying mail headers. That is why you are getting directed into the junk mail folder.

    you need to include something like this in your out going php mail function:

    Code:
     
    
    
           $headers = "MIME-Version: 1.0\n";
            $headers .= "Content-type: text/plain; charset=iso-8859-1\n";
            $headers .= "Content-Transfer-Encoding: 8bit\n";
            $headers .= "From: $_POST[u_name] <$_POST[u_email]>\n";
            $headers .= "X-Priority: 1\n";
            $headers .= "X-MSMail-Priority: High\n";
            $headers .= "X-Mailer: PHP/" . phpversion()."\n";
    
    
    
    mail($to, $subject, $MyMessage, $headers);
    try it let me know how you make out. That should solve your problem!

  11. #11
    Who is Mr Blonde? Mr Blonde's Avatar
    Join Date
    Sep 2006
    Location
    Gold Coast, QLD
    Posts
    359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks man,

    this was the kind of answer i was hoping for, however it still dosn't fix the problem
    Heavens Rejects : Online Clothing Store
    Alternative Clothing : Mr Blonde
    Front end development : By the Webfella

  12. #12
    Resident Code Monkey Chris Corbyn's Avatar
    Join Date
    Nov 2005
    Location
    Melbourne, Australia
    Posts
    713
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Most of this will still apply even if you're just using mail(): http://www.swiftmailer.org/wikidocs/v3/tips_spam

    But the key question... do you have a MX record for that domain? Hotmail is extremely difficult to deliver to because they have stupid spam controls whereby you can pay them to be whitelisted (typical MS monopolisation).

    The MX record and SPF record are *almost* critical for Hotmail.

  13. #13
    SitePoint Addict ruba's Avatar
    Join Date
    Apr 2005
    Location
    Amman -Jordan
    Posts
    339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Open Blocked website
    Open Blocked Website
    Knowledge Is Knowing That A Tomato Is A Fruit,
    Wisdom Is Not Putting It In A Fruit Salad.

  14. #14
    Who is Mr Blonde? Mr Blonde's Avatar
    Join Date
    Sep 2006
    Location
    Gold Coast, QLD
    Posts
    359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by d11wtq View Post
    The MX record and SPF record are *almost* critical for Hotmail.
    Cool thanks man ill look into it
    Heavens Rejects : Online Clothing Store
    Alternative Clothing : Mr Blonde
    Front end development : By the Webfella


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
  •