【发布时间】:2012-03-13 13:30:32
【问题描述】:
我正在尝试在我的电子邮件正文中使用 HTML 发送图像,但图像没有发送。我不知道我做错了什么。我尝试使用以下代码:
Intent i = new Intent(Intent.ACTION_SEND_MULTIPLE);
i.setType("text/html");
String tempStr = "<html><head><title></title><style> b{ color: red} </style></head><body><img src=\""+ "images/assaultoffences.png" + "\"><b>quick</b></body> </html>";
i.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(tempStr));
i.putExtra(Intent.EXTRA_EMAIL, new String[] {"ashwini.soma@gmail.com"});
i.putExtra(Intent.EXTRA_SUBJECT, "subject of email");
startActivity(i);
try {
startActivity(Intent.createChooser(i, "Send mail..."));
} catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(SavePage.this, "There are no email clients installed.", Toast.LENGTH_SHORT).show();
}
【问题讨论】:
-
对您的图像 src 的引用是否正确?
-
是的,我的图像是正确的。但是在正文中只有小符号
-
您有 13 个问题,其中大多数有多个答案。如果至少有一个问题的答案令您满意,那么您真的应该接受每个问题的最佳答案。
标签: android html-email