开发者

Zend Mail sending with headers shown in body and header section in mail clients

开发者 https://www.devze.com 2022-12-24 07:04 出处:网络
I am using Zend Framework to send mail. It\'s doing som开发者_运维技巧ething very odd, the content type, content dispostion, MIME version and content type encoding are all showing up in the header se

I am using Zend Framework to send mail.

It's doing som开发者_运维技巧ething very odd, the content type, content dispostion, MIME version and content type encoding are all showing up in the header section (under the subject) of the email in GMail and in Outlook.

The content of the email was also being included twice in the email, once as plain text and once as HTML. I stopped this by just using setBodyText() instead of using setBodyHtml() too. I had seen somewhere that you can use both. Now I just use setBodyText() like this

$mail = new Zend_Mail('utf-8');
$mail->addTo("mail@mail.com");
$mail->setSubject("Registration info");
$mail->setFrom('do-not-reply@mail.com', "A Name");
$mail->setBodyText($this->view->render('emails/register.phtml'));
$mail->send();


This has been solved. It was an error with the host receiving the email. The fact it was in Outlook or GMail made no difference as the error was with the host.

0

精彩评论

暂无评论...
验证码 换一张
取 消