I had shown the HTML file content in WebView.That is available in SDCard, I need to send that HTML Content as a email in the same format(HTML). Note: I don't want to send it from email client application.I need to send it without user interaction
3 Answers
At this other Answer there is a nice explanation of using javaMail API. and other option is you can use mailchamp library.
Comments
Yes, It is possible
1st off, give the manifest permission to
<uses-permission android:name="android.permission.INTERNET" />
then follow the tutorial
but little bit tricky, check this tutorial http://www.jondev.net/articles/Sending_Emails_without_User_Intervention_(no_Intents)_in_Android
Comments
Do this way
String htmalContentFromSdcard = "";
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("text/html");
i.putExtra(Intent.EXTRA_EMAIL, "[email protected]");
i.putExtra(Intent.EXTRA_SUBJECT, "Demosubject");
i.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(htmalContentFromSdcard));
try {
startActivity(Intent.createChooser(i, "Send mail..."));
finish();
} catch (android.content.ActivityNotFoundException ex) {
ting(getString(R.string.share_email_no_client));
}
Hope this helps you.
2 Comments
Finder
I had mention that, without using email client i need to send mail.By using intent it will send mail using email client only. I need to send mail without user interaction "Biraj Zalavadia"
Biraj Zalavadia
Not possible because of security aspect.You need some server in between to achieve this without user interaction.