开发者

ACTION_SEND text/html is not sending images using html image tag

I am sending and email that has embedded anchor tag to an image tag like so.

<p><a href=\"http://www.mycompanyurl.com\"><img src=\"http://www.mycompanyurl.com/assets/images/emails/logo_phone.png\" width=\"82\" height=\"22\" vspace=\"5\" border=\"0\"></a><br>"

What I'm getting on the receiving end when I get the email is "obj" tags in the body of the email. The links work correctly but the images dont display. What am I missing? Thank you very much for any help or hint in this matter. Below is my code.

final Intent email = new Intent(Intent.ACTION_SEND);
email.setType("text/html");
email.putExtra(Intent.EXTRA_SUBJECT, "test html with images");
email.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(new StringBuilder()
.append("<开发者_开发知识库!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\">")
.append("<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\" />")
.append("<title>test html with images</title><style type=\"text/css\"><!--body,td,th {  font-family: Arial, Helvetica, sans-serif;  font-size: 12px;    color: #000000;}body {  background-color: #FFFFFF;}a {  font-size: 12px;    color: #000000;}a:visited { color: #000000;}a:hover {   color: #666666;}a:active {  color: #000000;}--></style></head>")        
.append("<html><body bgcolor=\"#FFFFFF\"><div><table width=\"240\" height=\"360\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><tbody><tr><td align=\"center\" valign=\"top\">") 
.append("<p><a href=\"http://www.mycompanyurl.com\"><img src=\"http://www.mycompanyurl.com/images/emails/logo_phone.png\" width=\"82\" height=\"22\" vspace=\"5\" border=\"0\"></a><br>").toString()));


What is servicing the Intent, Email or Gmail?

I know Gmail does not support HTML email composition. It supports links and a subset of HTML formatting, but not HTML itself. The Gmail Android app supports more or less the formatting that you have available to you in the Gmail web app.

IIRC the Email app only supports links and basic text formatting like bold, italic, etc.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜