Aravelli Ramesh
Aravelli Ramesh

Reputation: 141

Sending mail using Intent

I am developing email application. I am sending mail using Intent

final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("plain/text");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{ address.getText().toString()});
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText());
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailtext.getText());
EmailappActivity.this.startActivity(Intent.createChooser(emailIntent, "Send mail..."));

when I run the application it is sending mail by synchronizing with existing mail account(like gmail whaever we configured). But, I want to pass username and password of from address programatically. Can any one please help me?

Upvotes: 0

Views: 472

Answers (1)

ariefbayu
ariefbayu

Reputation: 21979

You can't use intent if you want to set username & password programatically. Because android doesn't allow developer to be able to send email automatically using it's mail program. You can imagine what spam engine this vast amount of android device would become?

If you want to send email using user & password programatically, This related question can help you.

Upvotes: 1

Related Questions