我有一个忘记密码 TextView,我在其上执行了 onPressed() 事件,并希望应用程序将电子邮件发送到特定的预设电子邮件 ID。我的代码如下,但它不会向指定地址发送电子邮件。
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.."));