快速的多部分电子邮件 [英] Multipart email with swift

查看:46
本文介绍了快速的多部分电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 iPhone 上时,多部分邮件无法正确显示在 gmail 上.我有:

Multipart messages are not being correctly shown on gmail when on the iPhone. I have:

$message->setBody($this->body, 'text/html');
$message->addPart($this->text_body, 'plain/text');

我也用过:

$message->addPart($this->body, 'text/html');
$message->addPart($this->text_body, 'plain/text');

但在这两种情况下,当从 iPhone 读取 gmail 时,我收到的消息是MIME 附件"...没有 html,甚至无法读取 MIME 附件.如果我不添加文本部分,该消息将正常显示...

But in both cases, when reading gmail from the iPhone I get the message as a 'MIME-attachment'... No html and the MIME-attachment cannot even be read. The message will display fine if I don't add the text part...

有什么想法吗?

推荐答案

你需要做的:

$message->setBody($your_plain_text_email_here);
$message->addPart($your_html_email_here, 'text/html');

我刚刚遇到了完全相同的问题,这在 Mac 邮件应用程序、iPhone 邮件应用程序和 Horde(网络邮件,它以纯文本形式出现)上对我有用.

I just had the exact same question and this worked for me on the Mac mail app, iPhone mail app and Horde (webmail, it came up as plain text.)

这篇关于快速的多部分电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆