Hello everyone.
I need to use SMTP to send emails from a specific corporate email.
In Android 10, everything runs fine even with attachments.
But in Android 11, no mail is sent even with just text
In the manifest:
If anyone has used SMTP on Android 11, I would appreciate the support ?
I need to use SMTP to send emails from a specific corporate email.
In Android 10, everything runs fine even with attachments.
But in Android 11, no mail is sent even with just text
In the manifest:
B4X:
android:targetSdkVersion="29"
B4X:
Private Sub Button1_Click
If IsEmail(correo.Text.trim) = True Then
Dim smtp As SMTP
smtp.Initialize("smtp.gmail.com", 465, "xxxxx@gmail.com", "xxxxx", "smtp")
smtp.UseSSL = True
smtp.To.Add(correo.Text)
smtp.Subject = "Desde App"
smtp.Body = "Correo Enviado"
Wait For (smtp.Send) SMTP_MessageSent(Success As Boolean)
If Success Then
xui.MsgboxAsync("Correo enviado","Ok")
Else
xui.MsgboxAsync("No se envió","Oh oh")
End If
Else
ToastMessageShow("Correo inválido",True)
End If
End Sub
Sub IsEmail(EmailAddress As String) As Boolean
Dim MatchEmail As Matcher = Regex.Matcher("^(?i)[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])$", EmailAddress)
If MatchEmail.Find = True Then
Return True
Else
Return False
End If
End Sub
If anyone has used SMTP on Android 11, I would appreciate the support ?