Android html Mail sending
I have used the following code for sending a mail from my android app.
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("text/html");
emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[] { "" });
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Thai Hostess");
String emailText = "<html><body><p>Hi there,</p><p>Your friend wants you to watch this 开发者_运维问答video. <a href='http://TEST.com/Default.aspx?lang=eng&item=2'>Click here</a> to watch the video.</p></body></html>";
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(emailText));
startActivityForResult(Intent.createChooser(emailIntent, "Email:"), 1);
The code is calling the mailing service properly and the user gets two options i.e. Email and Google Mail. If I chose Google mail, the text is appearing in the mailing software and I can send the mail and receive it in proper format. But if we chose Email, then also the text appears properly(with the link mentioned in the text), but if I send the mail, the received mail does not have the link. I have test in different mail id of different standard mail service provider. Is there any problem in my code?
Do you explicitly want to send html's anchor ()?
In my application I also send a link via email, but I simply send http://site.com/abcd, which most email applications already understand as a http link
精彩评论