Is This Library Alredy here ?If yes then Sorry.Else I'm using it now to my mails in background.It's From this github project https://github.com/kristijandraca/BackgroundMailLibrary.I think only gmail is supported.Below is an example.
BackgroundMail
Version: 1
BackgroundMail
Version: 1
- BackgroundMail
Events:- onSending
- Initialize (EventName As String)
- IsInitialized As Boolean
- send
- android.permission.ACCESS_NETWORK_STATE
- android.permission.INTERNET
- android.permission.READ_EXTERNAL_STORAGE
- Attachment As String [write only]
- FormBody As String [write only]
- FormSubject As String [write only]
- GmailPassword As String [write only]
- GmailUserName As String [write only]
- MailTo As String [write only]
- ProcessVisibility As Boolean [write only]
- SendingMessage As String [write only]
- SendingMessageSuccess As String [write only]
-
B4X:
If txtEmail.Text.Trim <> "" Then Try BgMail.GmailUserName = "gmail@gmail.com" BgMail.GmailPassword = "password" BgMail.FormSubject = "PDF Invoice" BgMail.MailTo = txtEmail.Text.Trim BgMail.FormBody= "Dear customer, the below attachement contains your invoice in pdf format.Please contact us for more details." BgMail.Attachment = (File.Combine(File.DirRootExternal, FileName)) BgMail.SendingMessage= "Sending PDF Invoice To " & txtEmail.Text.Trim BgMail.SendingMessageSuccess = "Sent Successfully" BgMail.ProcessVisibility = True BgMail.send Catch Log(LastException) End Try Else ToastMessageShow("Email Connot Be Empty",True) Return End If
- Copy all the files to your additional lib folder and enjoy BackgroundMail.