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
            Asked
            
        
        
            Active
            
        
            Viewed 146 times
        
    3 Answers
1
            
            
        At this other Answer there is a nice explanation of using javaMail API. and other option is you can use mailchamp library.
 
    
    
        Community
        
- 1
- 1
 
    
    
        Sanket Kachhela
        
- 10,861
- 8
- 50
- 75
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
 
    
    
        Kirk
        
- 4,957
- 2
- 32
- 59
0
            
            
        Do this way
String htmalContentFromSdcard = "";
        Intent i = new Intent(Intent.ACTION_SEND);
        i.setType("text/html");
        i.putExtra(Intent.EXTRA_EMAIL, "abc@gmail.com");
        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.
 
    
    
        Biraj Zalavadia
        
- 28,348
- 10
- 61
- 77
- 
                    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" – Finder Jan 01 '14 at 06:58
- 
                    Not possible because of security aspect.You need some server in between to achieve this without user interaction. – Biraj Zalavadia Jan 01 '14 at 07:02
