Embedding image in email in Android

前端 未结 2 490
[愿得一人]
[愿得一人] 2020-12-04 00:12

Is it possible to programatically embed an image in the body of an email sent by the Mail app in Android?

Can I use the ACTION_SEND intent to do this, or should I c

2条回答
  •  长情又很酷
    2020-12-04 00:49

    to put the image in the body, you need to set the content type to "text/html" and then put an img tag in the email body. if you don't want to use a webserver to host the image, then you can use a data uri for the image.

    Info & Sample:

    Red dot
    

    If you want to attach an image to the email, you use the putExtra method and set it to EXTRA_STREAM.

    emailIntent.putExtra(android.content.Intent.EXTRA_STREAM, myImageStream);
    

提交回复
热议问题