简体   繁体   English

将图片附加到gmail正文中

[英]Attach image in body of gmail

I want to attach an image in body on gmail, I used below code 我想将图像附加在gmail身上,我使用了以下代码

if(imageuri != null){
    intent.putExtra(Intent.EXTRA_STREAM, imageuri);
    intent.putExtra(Intent.EXTRA_SUBJECT, "150+ Reasons to Quit Smoking");
    intent.putExtra(Intent.EXTRA_TEXT, "www.selftalk.info");
    intent.setType("image/*");
}else{
    intent.setType("plain/text");
}

but this just attach the image as attachment and I want to show it in body of gmail. 但这只是将图像附加为附件,我想将其显示在gmail正文中。 Can anybody tell me how can I do this? 谁能告诉我该怎么做?

Create an HTML mail body and use an IMG tag in there. 创建一个HTML邮件正文,并在其中使用IMG标签。 You can embed the image in the HTML using base64 encoding , but this may not work in all mail clients. 您可以使用base64编码将图像嵌入HTML中 ,但这可能不适用于所有邮件客户端。 Alternatively you may reference the image on an external server. 或者,您可以在外部服务器上引用该图像。

无需编码..只需在浏览器中以桌面模式打开Gmail ..有在线选项可用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM