为什么MFMailComposer与< img>没有在邮件中显示图像? [英] Why MFMailComposer with <img> is not showing the image in mail?

查看:108
本文介绍了为什么MFMailComposer与< img>没有在邮件中显示图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 MFMailComposer 在邮件中发送一些图片。我正在将图像转换为 Base64 并使用< img> 标记将图像添加到HTML正文(我不是将其添加为附件)。

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];

图像在 MFMailComposer 中正确显示,但没有显示图像在从MFMailComposer发送的实际邮件中。

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?

推荐答案

我在几周之前遇到了同样的问题,我发现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.

希望这个帮助。

这篇关于为什么MFMailComposer与&lt; img&gt;没有在邮件中显示图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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