0

I posted this question 6 days ago regarding yahoo email issue Email going to SPAM in yahoo and URL not working

Some guys told me there to use SMTP for email sending so that you will receive email in your inbox. I'm using SMTP but still my all emails goes to yahoo spam folder. I dont know what's wrong in my code. Can anyone please help me,

include_once("Mail.php");
$From = "FROM EMAIL";
    $To = "TO EMAIL";
    $Subject = "Test Email";
    $Message = "This is a test email using SMTP";
    $Host = "mail.DOMAIN.com";
    $Username = "USERNAME";
    $Password = "PASSWORD";
    $Headers = array("MIME-Version"=> '1.0', 
                     "Content-type" => "text/html; charset=iso-8859-1",
                     "From" => $From,
                     "To" => $To, 
                     "Reply-To" => $From,
                     "Subject" => $Subject);
    $SMTP = Mail::factory('smtp', array ('host' => $Host, 'auth' => true, 'username' => $Username, 'password' => $Password)); 
    $mail = $SMTP->send($To, $Headers, $Message); 
    if (PEAR::isError($mail)){ 
    echo($mail->getMessage()); 
    } else { 
    echo("Email sent successfully"); 

    }

Note : The issue is only with yahoo, other all emails goes to inbox

Community
  • 1
  • 1
Arif
  • 1,222
  • 6
  • 29
  • 60
  • when you send email using that smtp from your desktop mail client to yahoo does that email go to spam? – wayne Mar 18 '14 at 13:17
  • @wayne yes everytime email goes to spam in yahoo. – Arif Mar 18 '14 at 13:31
  • if your email send from desktop outlook being mark as spam in yahoo, then you have to read and add SPF/DKIM Record in the DNS. If you can't/don't have access to the domain then you can tell your client that you can't guaranty email delivery in this setup. – wayne Mar 18 '14 at 13:45
  • @wayne from where to add SPF/DKIM Record in the DNS. I have access to my cpanel. – Arif Mar 18 '14 at 14:25
  • um, you use cpanel email...if your cpanel version is 11.40 above read http://docs.cpanel.net/twiki/bin/vief/AllDocumentation/CpanelDocs/EmailAuthentication. if not, you go and sign up one of these: mailjet/mailgun/Mandrill. in their control panel they will allow you to get SPF/DKIM to add into your DNS. – wayne Mar 18 '14 at 14:40
  • Also, check your email content. Keep it really simple to make sure you are not triggering any spam filters. Large money amounts, words like 'free' and exclamation points for example will accumulate and trigger spam filters. – John Mar 18 '14 at 15:19
  • 4
    I'm voting to close this question as off-topic because questions about email deliverability are not really programming questions, and thus off-topic for Stack Overflow. See also https://meta.stackoverflow.com/questions/302903/off-topic-my-email-isnt-spam – tripleee Oct 09 '17 at 05:38

1 Answers1

1

To see if your mail server has a glaring problem that would cause other mail servers to think it's a spammer, try sending a message from your mail server to check-auth@verifier.port25.com. This service will do a bunch of checks, and you'll get a report back with ton of information, such whether or not your mail server's DNS is setup correctly, whether your mail server's IP is on any black lists, if you have a problem with your SPF records, etc.

animuson
  • 53,861
  • 28
  • 137
  • 147
mti2935
  • 11,465
  • 3
  • 29
  • 33