Android Question [SOLVED] Automatically sending an email from B4A

rleiman

Well-Known Member
Licensed User
Longtime User
Greetings,

I have been calling the phone's email like this.

B4X:
Dim msg As Email

msg.Subject = "Song Requests"
msg.Body = EditTextRequestedSongs.Text
msg.To.Add("ultraviproduction@gmail.com")

StartActivity(msg.GetIntent)

Is there a way in B4A to send the email from the app without actually displaying the email client on the screen in code?

Thanks.
 

rleiman

Well-Known Member
Licensed User
Longtime User
Check this one

B4X:
    Dim in As Intent
    in.Initialize("android.intent.action.SENDTO", "mailto:")
    in.PutExtra("android.intent.extra.EMAIL", Array As String(EmailToStr))
    in.PutExtra("android.intent.extra.SUBJECT", "Some Subj")
    in.PutExtra("android.intent.extra.TEXT",  BodyStr)
    StartActivity(in)
Thanks. We will try that tomorrow.
 
Upvote 0

Similar Threads

Top