B4A Library Background Mail

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
    Events:
    • onSending
    Methods:
    • Initialize (EventName As String)
    • IsInitialized As Boolean
    • send
    Permissions:
    • android.permission.ACCESS_NETWORK_STATE
    • android.permission.INTERNET
    • android.permission.READ_EXTERNAL_STORAGE
    Properties:
    • 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.
 

Attachments

  • BGMail.zip
    497.7 KB · Views: 337

somed3v3loper

Well-Known Member
Licensed User
Longtime User
Thanks for sharing library .
But isn't it possible to send emails in background services without this library . How is this lib different ?
 

jahswant

Well-Known Member
Licensed User
Longtime User
Thanks for sharing library .
But isn't it possible to send emails in background services without this library . How is this lib different ?
I Just shared a library that i wrapper to B4A.For a particular Problem there may be many solutions.
I used it to forget this other solution...
B4X:
'    Dim Message As Email
'    Message.Subject = "PDF Invoice"
'    Message.Body = "Dear customer, the below attachement contains your invoice in pdf format.Please contact us for more details."
'    Message.To.Add(txtEmail.Text.Trim)
'    Message.Attachments.Add(File.Combine(File.DirRootExternal, FileName))
'    StartActivity(Message.GetIntent)
I didn't want to see intents any more.
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…