Android Question SMTP Fail when use gmail

locxtronic

Member
Licensed User
Longtime User
hi i got this error when try use gmail with Net library.

java.lang.RuntimeException: Empty writer returned: 530-5.5.1 Authentication Required. Learn more at
530 5.5.1 https://support.google.com/mail/answer/14257 z12sm2426015pbt.73 - gsmtp

i have enable "less secure" in my google account but still no luck. Does google require advance auth system? here is my code.


B4X:
Dim theSmtp As SMTP
    Try
        Dim TextReader1 As TextReader
        TextReader1.Initialize(File.OpenInput(File.DirInternal, "save_config_email.txt"))
        rxMail = TextReader1.ReadLine
        txMail = TextReader1.ReadLine
        mailPassword = TextReader1.ReadLine
        TextReader1.Close

        theSmtp.Initialize("smtp.gmail.com",465,"mymail@gmail.com","password","SMTP")
        theSmtp.UseSSL = True
        theSmtp.Subject = "Android Security Lock System"
        theSmtp.To.Add(rxMail)
        theSmtp.Body = "Your phone last detected add " & lat & " , " & lon & " Attachment is picture taken from front camera."
        theSmtp.AddAttachment(dir,filename)
        theSmtp.Send()
    Catch
       Log(LastException.Message)
    End Try
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…