B4J Question Problem with SMTP and SMTP2go.com

jcesar

Active Member
Licensed User
Longtime User
Hi

I trying use smtp2go service to send email with SMTP but i get this error:

java.lang.RuntimeException: Empty writer returned: 503-All RCPT commands were rejected with this error:
503-503 sender not yet given
503 Valid RCPT command must precede DATA
at anywheresoftware.b4a.net.SMTPWrapper$1.run(SMTPWrapper.java:296)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)


with this code:
B4X:
email.Initialize("mail.smtp2go.com",587,"user_name","password","smtp")
email.To.Add("someone@gmail.com")
email.Subject = "Test"
email.Body = "testando mensagem pelo B4J do smtp2go"
email.StartTLSMode = True
email.Send
 

DonManfred

Expert
Licensed User
Longtime User
Try adding a
B4X:
email.Sender = "youremail@domain.com"
before the send command
like the error is suggesting
 
Upvote 0

jcesar

Active Member
Licensed User
Longtime User
Thanks for your reply, but this not work with smtp2go, i get the same error. The same code works fine with gmail.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
In their docu i can found other ports too... Try out

Sending via SMTP
SMTP server: Enter your account’s SMTP server. Log into your SMTP2GO control panel to see what this is.
SMTP port: 2525 (or 80, 25, 8025 or 587 if that doesn’t work).
Username / Password: Turn on SMTP authentication and enter your account’s SMTP username and SMTP password.
Note: TLS/SSL is optional. TLS is available on the same ports. SSL is available on ports 465 and 8465.
 
Upvote 0
Top