我正在创建一个应用程序,我必须在编辑文本中反馈并将此反馈发送回硬编码电子邮件地址。用户只需输入他的反馈并按下按钮,然后电子邮件将被发送到id。 ..现在在我的应用程序中写,而不是自动发送电子邮件,用户指向电子邮件页面。
请帮助我:)
public void onClick(View arg0) {
// TODO Auto-generated method stub
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
String[] recipients = new String[]{"email@example.com", "",};
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, recipients);
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Test");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "This is email's message");
emailIntent.setType("text/plain");
startActivity(Intent.createChooser(emailIntent, "Send mail..."));
finish();
}
});
答案 0 :(得分:2)
首先在项目中使用Mail.jar,activation.jar,Additional.jar文件上传
使用此邮件类..请按照此问题提供答案如何在Android中无意地发送邮件
Send email in android using JavaMail API with smtp but without SSL
享受!
答案 1 :(得分:1)