单击TextView将电子邮件发送到特定的电子邮件ID

时间:2012-07-05 10:43:50

标签: android email textview

我有一个Forgot Password TextView,我在其上执行onPressed()事件,并希望应用程序将Email发送到特定的预设电子邮件ID。我的代码如下,但它不会将Email发送到指定的地址。

    String value = "Hello Sir/Madam," + "\n" + "\t" + "Your email id and password are:" + "\n"  + passw;
    String[] address = {"nilaysheth@yahoo.co.in"};
    String subject = "Forgot Password";
    final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
    emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, address);
    emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
    emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, value);
    startActivity(Intent.createChooser(emailIntent, "Send Email.."));

1 个答案:

答案 0 :(得分:2)

看看这里,已经在这个论坛上被问到了: