2

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 3

1

At this other Answer there is a nice explanation of using javaMail API. and other option is you can use mailchamp library.

Sign up to request clarification or add additional context in comments.

Comments

1

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

0

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

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"
Not possible because of security aspect.You need some server in between to achieve this without user interaction.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.