Serial emails

wleupold

Member
Licensed User
Longtime User
I want to send a series of emails from my database app using the following code snipplet:
B4X:
Dim Message As Email
For i = 1 To Anzahl
Message.To.Add(“meine@Adresse.de”)
message.Subject = "Betreff”
message.Body = "Emailtext” 
StartActivity(Message.GetIntent) 
Next
Unfortunatly the loop doesn’t work properly. The order StartActivity(Message.GetIntent) only works once and the loop fails.
Is there another possibility to send emails as a series?
Thanks for any help.
:sign0163:
Werner
 
Last edited by a moderator:

Erel

B4X founder
Staff member
Licensed User
Longtime User
Do you get an error message? If yes then please post it.

The solution is to send the messages one after another. You should send an intent and then wait for Activity_Resume to be called and send the next one (and so on...).

A better (simpler and more reliable) solution is to use the Net library and send the mails yourself. Though you will need to ask the user password for that.
 
Upvote 0

wleupold

Member
Licensed User
Longtime User
Net library works fine

Thank you,
I tried the solution with the net library and that works fine.
:sign0098:
Werner
 
Upvote 0
Top