I want to send some message to particular email ID. I set the to address and trying to send messages. it’s working fine in Gmail App. but it’s not working properly in the Mail App especially in Nexus 7(HTC one V also) what the reason behind?
Source Code
Intent emailIntent = new Intent(android.content.Intent.ACTION_SENDTO);
emailIntent.setType("text/html");
emailIntent.setData(Uri.parse("mailto:naresh.repalle@shoregrp.com"));
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Price Check Guru Feedback");
startActivity(Intent.createChooser(emailIntent, "Email:"));
Updated Code
Intent emailIntent = new Intent(android.content.Intent.ACTION_SENDTO);
emailIntent.setType(“text/html”);
//set the To address and Subject
try
{
String strSubject = URLEncoder.encode("Price Check Guru Feedback","UTF-8");
//testing
emailIntent.setData(Uri.parse("mailto:naresh.repalle@shoregrp.com"+ "?subject=" + strSubject));
}
catch (UnsupportedEncodingException e)
{
e.printStackTrace();
}
startActivity(Intent.createChooser(emailIntent, "Email:"));
Despite all the rumours which people spread on forums (and also here), not all Android e-mail apps support a mixture of
SENDTO/mailto:andEXTRAs. Period. You’ve chosen an approach which is not supported by all apps (including K-9), that’s all.What seems to work is including the subject and body in the URL with
?subject=and&body=, usingUri.encode(). However, please be aware that the standard Android e-mail client V3.0 erases all+signs form such a message, probably due to wrong decoding.Update: Okay so that’s not your problem; lucky you. Of course, you can force the system to provide the chooser; have you not googled your problem? Although, if it does not fire, it means that the user chose Google mail over the proprietary e-mail program before.