[英]How to send an email from a specific mail to some other email id?
I want to email some credentials to a specific email address. 我想将一些凭据通过电子邮件发送到特定的电子邮件地 From what email address will this mail be sent?
从哪个电子邮件地址发送此邮件?
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("message/rfc822"); i.putExtra(Intent.EXTRA_EMAIL , new
String[]{"recipient@example.com"}); i.putExtra(Intent.EXTRA_SUBJECT,
"subject of email"); i.putExtra(Intent.EXTRA_TEXT , "body of
email");
try {
startActivity(Intent.createChooser(i, "Send mail...")); } catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(MyActivity.this, "There are no email clients installed.", Toast.LENGTH_SHORT).show();
}
Who is the sender here? 谁是这里的发件人?
This intent will open the mail clients available in your device. 此意图将打开设备中可用的邮件客户端。 Then its up to you to add sender email ID.
然后由您来添加发件人电子邮件ID。 Or it will take default email ID if you have already logged in.
如果您已经登录,它将采用默认电子邮件ID。
You should use JavaMail Api for this You can send & access email with the help of this:-- Check this ! 您应该使用JavaMail Api这样您可以通过以下方式发送和访问电子邮件: - 检查这个 !
& here is the library ! 这是图书馆 !
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.