为什么 MFMailComposer 带有 ?邮件中没有显示图像?
我正在使用MFMailComposer通过邮件发送一些图像。我将图像转换为 Base64 并使用 标签将图像添加到 HTML 正文(我没有将其添加为附件 )。
[htmlString appendFormat:
@"<img src='data:image/png;base64,%@' width=300 height=200 />", imageAsBase64];
图像在 MFMailComposer 中正确显示,但从 MFMailComposer 发送的实际邮件中没有显示图像。
我应该做什么才能让它发挥作用?
I am sending some images in mail using MFMailComposer. I am converting the image to Base64 and using <img>
tag to add images to the HTML body(I am not adding it as attachment).
[htmlString appendFormat:
@"<img src='data:image/png;base64,%@' width=300 height=200 />", imageAsBase64];
The images are displaying correctly in MFMailComposer, but there are no images displayed in the actual mail which is sent from the MFMailComposer.
What should I do to make it work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
几周前我遇到了同样的问题,我发现 Gmail 不支持嵌入图像。您可以在其他邮件提供商(例如您的域电子邮件)中查看电子邮件中的图像,但不能在 Gmail 中查看。
尝试发送另一封电子邮件,您可以看到图像。您需要添加图像作为附件,然后您就可以看到图像,它将显示在电子邮件正文的底部。
希望这有帮助。
I had same problem before couple of weeks and I came to know that Gmail is not supporting embedded images. You can see images in email in other mail provider like your domain email but not in Gmail.
Try to send another email and you can see images. You need to add images as attachment then you can see images and it will display bottom of your email body.
Hope this help.
您必须将图像添加为附件。您在 HTML 中看到的呈现的电子邮件无法通过缺少图像 URL 正确呈现。
这是一个例子:需要注意的是,如果您想包含 PDF 之类的内容,则必须包含图像,否则 mfmailcomposer 将失败......这是苹果错误。
我找到了解决方案...我在苹果雷达上提交了一个关于它的错误。 MFMailcomposer 有一个错误,您必须发送图像以及额外的附件才能使 pdf 之类的奇怪项目正常工作...尝试此操作并将 pdf 替换为您的卡片:
You have to add the images as an attachment. The rendered email that you see with HTML doesn't get rendered properly with the missing image URL.
here is an example: the caveat is that if you want to include things like a PDF you must include an image otherwise mfmailcomposer will fail... this in an apple bug.
I found the solution... Isubmitted a bug on Apple radar about it. MFMailcomposer has a bug in which you have to send an image along with your extra attachments in order to get the weird items like a pdf to work... try this and replace the pdf with your card: