Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4331768
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:09:34+00:00 2026-05-21T10:09:34+00:00

I am writing an android app and at some point I need to send

  • 0

I am writing an android app and at some point I need to send an email to a user specified address. To do this I am opening an email app and filling in the subject and body allowing the user to fill in the recipient. The email being sent should be html that I pull from a pre specified webpage. Pulling the html from the web is simple, but won’t display properly when emailed. The code I am using to open the email app is:

intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/html");
intent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.shareSubject));
intent.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(body));
startActivity(Intent.createChooser(intent, "Email:"));

This should allow the user to select their email client and send an html email if the selected client supports it. I have been testing with the gmail app which has been reported to support it, but when the email is received it is in plain text.

If it helps, the code I am essentially using to get the code is:

String input;
String body = "";
try
{
    URL url = new URL("<url>");
    BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
    while((input = in.readLine()) != null)
        body = body + input;    
}
catch(MalformedURLException e)
{

}
catch(IOException e)
{

}

I’m not sure why this is failing, everything I have looked at says that the gmail app supports sending html emails and that this is the code to do it. Any help would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T10:09:35+00:00Added an answer on May 21, 2026 at 10:09 am

    Your question is very similar to the question Send HTML mail using Android intent.

    You can see a bunch of suggested solutions there. I’d prefer mdaddy’s solution of the Android-specific version of the JavaMail API available here:

    http://www.jondev.net/articles/Sending_Emails_without_User_Intervention_%28no_Intents%29_in_Android

    This way, you wouldn’t have to open (or rely on) any external mail application. Instead, you could take the email address as input from within your application and do all the sending behind the scenes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing simple Android app to filter some events from user's calendar. The questions
I am writing an android app. I want to pass some data across the
I'm writing my first location based android app, but got confused about some of
I am writing a simple Android app and have a database that will send
I'm writing my first client/server android app, and need an advice regarding server architecture.
I'm writing an Android app in Eclipse, and displaying some text on screen using
I am looking into writing an Android app that has a database of approximately
I'm writing an Android App and I'm looking for the fastest (In terms of
I'm writing an Android app. I have a main method, which creates and runs
I'm writing an android application that maintains a lot of state data...some of it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.