2011-06-22 74 views
1

我正在发送和将具有嵌入锚定标记的电子邮件发送到像这样的图像标记。ACTION_SEND文本/ html不使用html图像标记发送图像

<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>" 

当我收到电子邮件时,接收端收到的是电子邮件正文中的“obj”标签。链接工作正常,但图像不显示。我错过了什么?非常感谢您对此事提供任何帮助或暗示。以下是我的代码。

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())); 

回答

1

什么是服务的意图,电子邮件或Gmail?我知道Gmail不支持HTML邮件组合它支持链接和HTML格式的一个子集,但不支持HTML本身。 Gmail Android应用支持您在Gmail网络应用中提供的或多或少的格式。

IIRC电子邮件应用只支持

+0

即时通讯使用Gmail和其发送到雅虎帐户链接和基本的文本格式,如粗体,斜体等。 – Byron

+0

然后,就像我说的那样,Gmail不支持您要做的事。 – cyngus