设置使用startActivity电子邮件的发送者(mailIntent) [英] setting the sender of an email using startActivity(mailIntent)

查看:142
本文介绍了设置使用startActivity电子邮件的发送者(mailIntent)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用这种code我的Andr​​oid应用程序的电子邮件发送:

I send in my android app emails using this code:

  Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
            emailIntent.setType("plain/text");
            emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{"recipient"+"@email.com"});
            emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject");
            emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Text");
            startActivity(Intent.createChooser(emailIntent, "Send mail..."));

但邮件程序使用了错误的邮件帐户。
现在,我尽量选择发件人的电子邮件地址/邮件帐户。有喜欢的东西:

but the mail program uses the wrong mail account. Now I try to select the senders email address/mail account. Is there something like:

    emailIntent.putExtra(android.content.Intent.EXTRA_SENDERS_MAIL_ADDRESS, "My_email_address@email.com");

    emailIntent.putExtra(android.content.Intent.EXTRA_USERS_EMAIL_ACCOUNT, "mail_account_x");

推荐答案

没有有没有像你上面提到的内容。默认情况下它会选择用于激活手机作为发件人的默认电子邮件ID。然而然后用户可以将其更改为其他帐户,如果它们被添加到手机上也是如此。

No there is nothing like what you mentioned above. By default it would choose the default email id used to activate the phone as the sender. However user can then change it to other accounts if they are added onto the phone as well.

这篇关于设置使用startActivity电子邮件的发送者(mailIntent)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆