This is my code for sending an HTML email in Android, with a clickable link.
private void sendEmail()
{
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
String subject = "Prueba";
String emailtext = "<a href=http://www.google.es>PruebaEmail</a>";
emailIntent.setType("message/rfc822");
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(emailtext.toString()));
startActivity(Intent.createChooser(emailIntent, "Send mail"));
}
Months ago, it was working and sends a clickable hyperlink, but for now, when I receive the mail in my GMail account, there is no hyperlink, just plain text.
I have tried all of this in the type:
emailIntent.setType("message/rfc822");
and
emailIntent.setType("plain/text");
and
emailIntent.setType("text/html");
and this for the text:
String emailtext = "<a href=http://www.google.es>PruebaEmail</a>";
and
String emailtext = "<a href='http://www.google.es'>PruebaEmail</a>";
and
String emailtext = "<a href="http://www.google.es">PruebaEmail</a>";
but none of that are working.
This issue is just for GMail, because if I send the mail to Evernote or another app, I got a clickable link.
This is my API configuration:
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="8"/>
and compiling with Android 3.2
Any ideas?