发送数据在后台以电子邮件 [英] send data to email in background
问题描述
我的工作就发送我的电子邮件Id.I已经由含EDITTEXT(用于EMAILID)和一个按钮MainActivity类别我的消息数据。
另一类是在我检索数据广播接收器类。
现在我不知道如何将数据发送到所提供的电子邮件的背景。
我用Google搜索了很多,但无法获得所需的响应。
请分享想法和帮助我的。
I am working on sending my message data on my email Id.I have made a mainActivity class containing an editText (for emailId) and a Button. Another class is BroadcastReceiver class in which I retrieve data. Now I can't understand how to send that data to the provided email in Background. I have googled a lot but can't get the required response. Please share the ideas and help me in it.
推荐答案
我为这个创建的开源库。用法很简单:
I create open source library for this. Usage is very simple:
BackgroundMail bm = new BackgroundMail(context);
bm.setGmailUserName("yourgmail@gmail.com");
bm.setGmailPassword("yourgmailpassword");
bm.setMailTo("receiver@gmail.com");
bm.setFormSubject("Subject");
bm.setFormBody("Body");
bm.send();
有了这个权限
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
您可以在这里下载:
<一href=\"https://github.com/kristijandraca/BackgroundMailLibrary\">https://github.com/kristijandraca/BackgroundMailLibrary
这篇关于发送数据在后台以电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!