E-Mail


this is how to structure an intent to choose an e-mail client, and start to perpare an e-mail to send.

Intent i = new Intent(Intent.ACTION_SEND);
i.setType(“text/plain”);
i.putExtra(Intent.EXTRA_EMAIL  , new String[]{“me@gmail.com”}); // here you put the e-mail address you want to sent the e-mail to.
i.putExtra(Intent.EXTRA_SUBJECT, “this is were you put the title”);
i.putExtra(Intent.EXTRA_TEXT   , “this is the place you nput the text”);
try {
startActivity(Intent.createChooser(i, “Send mail…”));
} catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(contactme.this, getString(R.string.Emails_Not_Found), Toast.LENGTH_SHORT).show();
}

to send an e-mail to multiple e-mail addresses replace

“me@gmail.com”

with

“me@gmail.com”, “me2@gmail.com”

or how ever many e-mail addresses you want to send the email to. also to create a new line add “\n” to you text

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: