【发布时间】:2012-02-03 22:25:13
【问题描述】:
IO 想在 android 中发送 html 格式的电子邮件。我可以通过 gmail 客户端发送邮件,但是当我使用任何其他客户端时,我无法获得 html 的样式。我用过下面的代码
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("text/html");
i.putExtra(Intent.EXTRA_SUBJECT, "TestMail");
i.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml("<p><b>Some Content</b></p>"));
try {
startActivity(Intent.createChooser(i, "Send mail..."));
} catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(EmailHtmlActivity.this, "There are no email clients installed.",Toast.LENGTH_SHORT).show();
}
【问题讨论】:
-
请不要在标题中使用 CAPSLOCK...