从Gmail中直接从Android版我的应用程序发送电子邮件,而无需打开Gmail撰写活动 [英] Sending email from gmail directly in android from my app without opening the gmail compose activity

查看:184
本文介绍了从Gmail中直接从Android版我的应用程序发送电子邮件,而无需打开Gmail撰写活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发Android应用程序,其中一个活动,我想发送的电子邮件。

I am developing an android app where in an activity, I want to sent email.

现在的方案是:
 1.活动只能通过默认的Gmail帐户的Andr​​oid设备发送电子邮件。 (无发送通过选择器会显示)
 2.邮件会自动无需打开Gmail撰写活动,当我点击我的活动的SEND键发送。

Now the scenarios are: 1. The activity will send email only via the default gmail account of the android device. (No "Send via" picker will be shown) 2. the mail will automatically be sent without opening the gmail compose activity when I click on the SEND button of my Activity.

我怎样才能做到这一点?

How can I do that ?

其他的问题:是否有可能到时,Gmail的主题和邮件正文从我的应用程序不能发送的编辑?如果可能的话,又如何?

Additional question: is it possible to disable editing of send to, subject and email body of gmail from my app ?? if possible, then how ??

推荐答案

按照克里希纳提议的链接
把你的主题和正文作为一个TextView(不EditText上)

follow the link that krishna suggested put your subject and body as a textview (not edittext)

和在这些线路是:

GMailSender sender = new GMailSender("username@gmail.com", "password");
                sender.sendMail("My Subject That cannot be changed",   
                        "My Body That cannot be changed",   
                        "user@gmail.com",   
                        "user@yahoo.com");  

,并按照此链接提出的所有步骤:
<一href=\"http://stackoverflow.com/questions/2020088/sending-email-in-android-using-javamail-api-without-using-the-default-built-in-a\">Sending使用JavaMail API,而无需使用电子邮件中的Andr​​oid默认/内置应用

这篇关于从Gmail中直接从Android版我的应用程序发送电子邮件,而无需打开Gmail撰写活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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