簡體   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