Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Mar 2005
    Posts
    59
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Post PHP Mail Function E-mails Go To Spam Folder...

    Hello,

    On my website, I have many automated e-mails containing userid's, passwords and order confirmations. The problem is many of these e-mails do not reach the sender or go into the e-mail's spam folder for yahoo and msn accounts. I have tested this over and over and the e-mails do go. Is there any solution to this? Below is the source code for the e-mails.
    Thank you for your help!

    PHP Code:
    //Mail Headers
    $from="webmaster@test.com";
    $headers  "From: $from\r\n";
    $headers .= "Reply-To: $from\r\n";
    $headers .= "Return-Path: $from\r\n";
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

    //E-mail Info -Fictional Stuff
    $email_addr="bill@hotmail.com"//Usually grabbed from database
    $subject="E-mail Subject Line";
    $message="E-mail Content Goes Right Here...";

    //Mail Function
    mail($email_addr$subject$message$headers,"-f $from");

    //I think that's all. 

  • #2
    $object->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Jun 2003
    Posts
    3,092
    Thanks
    2
    Thanked 23 Times in 23 Posts
    Looks like your syntax is incorrect. Here's an example from the manual:

    The additional_parameters parameter can be used to pass an additional parameter to the program configured to use when sending mail using the sendmail_path.
    PHP Code:
    <?php
    mail
    ('nobody@example.com''the subject''the message'null,
       
    '-fwebmaster@example.com');
    ?>
    BTW, you'd do well to read that whole page I gave the link to. There's a lot of good information about sending mail in a PHP program.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    SNAP to it!

  • #3
    New Coder
    Join Date
    Mar 2005
    Posts
    59
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks for the reply vinyl.

    So is this the part you see is worng? '-fwebmaster@example.com'

    Also, what does null represent in the mail function? I couldn't find any refrence to it in the manual except it being used in a demo with no refrence to it but I might of missed it.
    Thank you.

  • #4
    New Coder
    Join Date
    Mar 2005
    Posts
    59
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Nevermind about the null question. I figured that one out. I did change a couple of things but it didn't change a thing. E-mails still won't go through hotmail. Any other suggestions?

  • #5
    $object->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Jun 2003
    Posts
    3,092
    Thanks
    2
    Thanked 23 Times in 23 Posts
    The only thing I can think of is to read that whole page I referenced. Lots of people have problems with the mail ending up in the spam folder. Unfortunately, there isn't a "one size fits all" solution.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    SNAP to it!

  • #6
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Services like hotmail and yahoo detect whether an email was generated using a machine (server-side form) or software (e.g. outlook express).

    Alot of generated emails have problems with hotmail and yahoo for this reason.


    Also check your subject line to make sure it has no spam keywords.

  • #7
    New Coder
    Join Date
    Mar 2005
    Posts
    59
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks for the help and suggestions. The best I have been able to is complete acceptence from yahoo mail and with hotmail it goes in the spam folder. I spent hours tweaking my e-mail headers...

  • #8
    New to the CF scene
    Join Date
    Sep 2008
    Location
    India
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    When i am sending mail from the plesk vps hosting server, it goes to spam?

    Hi friends ,

    I am using the plesk vps server,
    When i used to sending the mails from the php SMTP code(phpmailer class),
    then that mail send to spam folder,

    This is happen to when i am usied to send the mail to yahoo mail id.

    How to solve this issue.

    please help me.

    Anil Kumar

    http://anil2u.wordpress.com


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •