This code works OK in Basic4 me!
But not B4j
Why can it be?
ERROR CONSOLE :
Program started.
java.lang.RuntimeException: Empty writer returned: 530-5.5.1 Authentication Required. Learn more at
530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 e50sm16388336yhd.26 - gsmtp
at anywheresoftware.b4a.net.SMTPWrapper$1.run(SMTPWrapper.java:269)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
But not B4j
Why can it be?
B4X:
Sub SendEmail (mail As String)
Dim SMTP1 As SMTP
Dim server As String : server= "smtp.gmail.com"
Dim port As Int : port= 465
Dim emailname As String : emailname="[email protected]"
Dim password As String : password="XXXX"
Dim protocol As String : protocol="SMTP"
Dim destEmailAdress As String : destEmailAdress="[email protected]"
'Crear
SMTP1.Initialize(server, port, emailname, password, protocol)
SMTP1.UseSSL = True
' Enviar
SMTP1.To.Add (mail)
SMTP1.Subject = "Te invito a probar MultiGuía DIGITAL 2013"
tmp="Hola te invito a que pruebes este magnifico programa gratuito, para tener siempre a mano los números de teléfonos de San Cristobal y Zona, además te muestra las Farmacias de turnos y mucho más...!" & CRLF
tmp=tmp & "Podés descargarlo de acá >> " & CRLF & "www.desoft.com.ar/guia.exe" & CRLF & CRLF
tmp=tmp & "Es seguro y simple, después contame" & CRLF & CRLF
tmp=tmp & "Un saludo!"
SMTP1.Body =tmp
SMTP1.Send
End Sub
Sub SMTP_MessageSent(Success As Boolean)
If Success=False Then
Msgbox.Show ("FAIL","")
Else
Msgbox.Show ("OK","")
End If
End Sub
ERROR CONSOLE :
Program started.
java.lang.RuntimeException: Empty writer returned: 530-5.5.1 Authentication Required. Learn more at
530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 e50sm16388336yhd.26 - gsmtp
at anywheresoftware.b4a.net.SMTPWrapper$1.run(SMTPWrapper.java:269)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Last edited: