如何(使用默认帐户)从机器人发送电子邮件? [英] How to send email from android (using the default account)?

查看:463
本文介绍了如何(使用默认帐户)从机器人发送电子邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想利用属于Android上的同步用户护目镜帐户凭据发送电子​​邮件的背景下,有可能实现吗?

I would like to leverage the goggle account credentials belonging to the synced user on android to send emails in the background, it is possible to achieve that ?

如果没有,是否有可能要求用户发送电子邮件(含意向)并获得接收的电子邮件?也许通过调用startActivityForResult?

If not, is it possible to ask the user to send an email (with an intent) AND get the receiver's email ? maybe by calling startActivityForResult ?

干杯,

推荐答案

您的问题是通过故意发送电子邮件

You question is to send email via intent

Intent emailIntent=new Intent(Intent.ACTION_SEND);
emailIntent.putExtra(Intent.EXTRA_EMAIL,new String[]{"email@address.com"});
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "subject");
emailIntent.putExtra(Intent.EXTRA_TEXT, "body");
emailIntent.setType("text/plain");
startActivity(emailIntent);

要发送电子邮件在后台使用JavaMail API与激活框架。

To send email in background use JavaMail API with activation framework.

这篇关于如何(使用默认帐户)从机器人发送电子邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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