Android problem: trying to send a link by email

I send a simple email, and in the body I put a link.

My problem is that the link is not recognized as a link, but only as a string

Here is the code:

intent.putExtra(Intent.EXTRA_EMAIL,new String[]{ " Support@bift.net "}); Uri myUri = Uri.parse("http://www.stackoverFlow.com/"); intent.putExtra(Intent.EXTRA_TEXT, "Check out this great application:"+"\n"+ myUri); intent.putExtra(Intent.EXTRA_SUBJECT, "Traveler Pharmacy"); intent.setType("text/plain"); startActivity(Intent.createChooser(intent, "Choose Email Client")); startActivity(intent); 

thanks for the help

+4
source share
2 answers

Change two lines:

 intent.setType("text/html"); 

and

 intent.putExtra(Intent.EXTRA_TEXT, Html.fromHtml("Check out this great application: <a href=\""+ myUri+ "\">Link</a>")); 
+10
source

Perhaps this link may help: android send html mail using intent . More specifically, you can try Andy Cochran's suggestion.

0
source

All Articles