繁体   English   中英

如何在Android应用程序中将SD卡图像添加到电子邮件正文中

[英]how to add SD card image into email body in android application

我想将图像添加到电子邮件body.i不要在邮件中使用附件。

  String imagepath ;
 Imagepath = Environment.getExternalStorageDirectory()+ File.separator + "ImagesCmas/"+image_name;

 final Intent sendIntent = new Intent(Intent.ACTION_SEND);
            sendIntent.setType("image/jpg");
            sendIntent.putExtra(Intent.EXTRA_SUBJECT,"Happy Christmas");
            sendIntent.putExtra(Intent.EXTRA_TEXT,"Find Greeting Attachment");
            sendIntent.putExtra(Intent.EXTRA_TEXT, Uri.parse(imagepath));
            startActivity(Intent.createChooser(sendIntent, "Send Mail"));

如何将SD卡图像发送到邮件正文而无需附件。

我不认为这是可能的。

您可以将其添加为附件,或将mime类型设置为html并将标记嵌入到外部图像中

<img src="http://imgur.com/myimage.png"></img>

电子邮件正文只能包含html或纯文本

以下是一些链接 - 如果您在使用这些链接时遇到问题,请发布您的代码,我会尝试进一步提供帮助。

Android写入SD卡文件夹

http://androidgps.blogspot.com/2008/09/writing-to-sd-card-in-android.html

https://sites.google.com/site/androidhowto/how-to-1/save-file-to-sd-card

暂无
暂无

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

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