Zend_Mail sent email is treated as SPAM

前端 未结 1 661
慢半拍i
慢半拍i 2021-01-03 00:19

Please tell me what I am doing wrong. I am sending an email using the Zend_Mail class like this:

$message = <<

        
相关标签:
1条回答
  • 2021-01-03 01:16

    I have solved this by adding these lines:

    $mail->setReplyTo('contact@company.com', 'Company');
    $mail->addHeader('MIME-Version', '1.0');
    $mail->addHeader('Content-Transfer-Encoding', '8bit');
    $mail->addHeader('X-Mailer:', 'PHP/'.phpversion());
    

    The critical line seems to be adding Reply-To header. Without that it would always go to SPAM. Once I set the Reply-To header email clients stopped treating it as spam.

    0 讨论(0)
提交回复
热议问题