thanks Erel,
I will try to follow your instructions as close as possible.
1. Relevant code:
[Note: It is still an activity app, I tried to port it to an B4XPages app. The Code excerpts are from my new port to B4XPages / as same error occurs in an B4XPages app]
Starter Service:
Sub Service_Start (StartingIntent As Intent)
StartService(EmailSender) 'I tried receiver first, now I tried Service. Same Error happens
End Sub
Email Sender Service::
Sub Service_Start (StartingIntent As Intent)
SmtpClient.Initialize("smtp.gmail.com", 587, "fahrstundenplaner.termi@gmail.com", "application_password_here", "smtpClient")
'SmtpClient.Initialize("mail.gmx.net", 587, "fahrstundenplaner@gmx.net", "application_password_here", "smtpClient")
SmtpClient.StartTLSMode = True
End Sub
Sub Send (email As String, subject As String, message As String)
'SmtpClient.AuthMethod = SmtpClient.AUTH_LOGIN 'This doesn't help / same error
SmtpClient.To.Clear
SmtpClient.To.Add(email)
SmtpClient.HtmlBody = False
SmtpClient.Subject = "test"
SmtpClient.Body = "test"
Dim sf As Object = SmtpClient.Send
Wait For (sf)smtpClient_MessageSent (Success As Boolean)
If Success Then
Log("Email sent")
Else
Log("error: " & LastException)
ToastMessageShow(LastException, True)
End If
End Sub
_____________________________
2.
a.
I used this code to test: http call (HttpJob)
Private j1 As HttpJob
j1.Initialize("j", Me)
j1.Download("https://google.com")
Wait For (j1) JobDone(j As HttpJob)
If j.Success Then
Dim res As String = j.GetString
Log(res)
'Log($"Clean:"$)
Else
Log(j.ErrorMessage)
End If
j.Release
This code basically works in a service.
Interestingly it doesnt work, if i have a breakpoint before the Wait for, but without breakpoint the httpJob works fine.
2.
b.
I have registered also at GMX and also Yahoo. Yahoo regrets they are not able to create an account and GMX delivered another error 503 (bad sequence of commands)
Google basically works, the only problem is when SMTP is started from a receiver / service.