从 Zend Mail 添加封装的电子邮件(如转发的电子邮件)
我试图让 Zend_Mail 发送封装的消息 - 就像转发电子邮件一样。
$attachedContent = "<h1>H1 Email</h1>";
$emailContent = "<h1>Email Content>";
$mail = new Zend_Mail();
$mail->setBodyText('text content');
$mail->setBodyHtml($emailContent);
$mail->setFrom('[email protected]', 'GAS');
$mail->addTo('[email protected]', 'GAS');
$at = $mail->createAttachment($attachedContent);
$at->type = 'message/rfc822;
name="forwarded message"';
$at->disposition = Zend_Mime::DISPOSITION_INLINE;
$at->encoding = Zend_Mime::ENCODING_7BIT;
$mail->setSubject('Test');
$mail->send();
邮件客户端正在获取电子邮件,呈现正常的 HTML 内容,并显示转发的消息并呈现其内容,但是,它的格式如下:
<h1>Email Content</h1>
你能看到我做错了什么吗?我在网上没有找到任何内容,并已尽力从查看电子邮件源中复制格式。
干杯,
基兰
I'm trying to get Zend_Mail to send an encapsulated message - as though it's forwarding an email.
$attachedContent = "<h1>H1 Email</h1>";
$emailContent = "<h1>Email Content>";
$mail = new Zend_Mail();
$mail->setBodyText('text content');
$mail->setBodyHtml($emailContent);
$mail->setFrom('[email protected]', 'GAS');
$mail->addTo('[email protected]', 'GAS');
$at = $mail->createAttachment($attachedContent);
$at->type = 'message/rfc822;
name="forwarded message"';
$at->disposition = Zend_Mime::DISPOSITION_INLINE;
$at->encoding = Zend_Mime::ENCODING_7BIT;
$mail->setSubject('Test');
$mail->send();
Mail clients are getting the email, rendering the normal HTML content, and displaying the forwarded message and rendering its contents, however, it's formatting like:
<h1>Email Content</h1>
Can you see what I'm doing wrong? I've not found anything online, and have tried my best to copy the formatting from looking at email source.
Cheers,
Kieran
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许是这些线路造成的?
maybe these lines are causing it??