SergeNova
Member
Hello everyone, I am trying to send an e-mail via SMTP with POP but the application stops just as I call this service.
I have checked the code but cannot find what is causing the application to stop. Can you help me. Thank you
B4X:
Sub Process_Globals
Dim emailing As clsemail
Dim YOUR_GMAIL_PASSWORD As String = "xxxxxxxx"
Dim list1sec As List
Dim Subject As String = "Trying"
Dim Body As String = "B4A Send Email"
End Sub
Sub Service_Start (StartingIntent As Intent)
Dim a As String = "xxxx@gmail.com"
Dim b As String = "yyyy@gmail.com"
emailing.Initialize(Me, "smtp.gmail.com", "pop.gmail.com", a, YOUR_GMAIL_PASSWORD, b, b)
If File.Exists(File.DirInternal, "1.txt") = True Then
list1sec = File.ReadList(File.DirInternal, "1.txt")
End If
Send
End Sub
Sub Send
Dim res As ResumableSub = emailing.SendEmail(Subject, Body, list1sec)
Wait For (res) Complete (Success As String)
If Success Then
ToastMessageShow("Send", True)
Else
ToastMessageShow("Error", True)
End If
End Sub