0

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?

Fuzzical Logic
  • 12,947
  • 2
  • 30
  • 58
Aravelli Ramesh
  • 131
  • 1
  • 2
  • 5

1 Answers1

1

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.

Community
  • 1
  • 1
ariefbayu
  • 21,849
  • 12
  • 71
  • 92
  • thank for your response.I am able to send mails using smtp.gmail.com. But iam Unable send using smtp.mail.yahoo.com. Please help me. – Aravelli Ramesh Jun 11 '12 at 07:14
  • for different question, you should choose and answer in this question and create new question on different problem. – ariefbayu Jun 11 '12 at 07:17
  • @AravelliRamesh::here is link for server settings of yahoo smtp, refer this http://www.emailaddressmanager.com/tips/mail-settings.html – KMI Jun 11 '12 at 07:59
  • silent, I tried as per the link you have given me. then only i got that doubt. – Aravelli Ramesh Jun 11 '12 at 08:19