send data to email in background

后端 未结 3 1250
粉色の甜心
粉色の甜心 2020-12-19 14:16

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

3条回答
  •  [愿得一人]
    2020-12-19 14:47

    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();
    

    With this permissions

    
     
    

    You can download it here: https://github.com/kristijandraca/BackgroundMailLibrary

提交回复
热议问题