Android Question SMTP send mail error via outlook for help.

teddybear

Well-Known Member
Licensed User
I wirte an email client with Net libaray, the code just smtp example.
like this.
B4X:
Sub Process_Globals
  Dim SMTP As SMTP
End Sub
Sub Globals

End Sub

Sub Activity_Create(FirstTime As Boolean)
  If FirstTime Then
    SMTP.Initialize("smtp-mail.outlook.com", 587, "my@outlook.com", "mypassword", "SMTP")
    SMTP.StartTLSMode = True
  End If
  SMTP.To.Add("othermail@example.com")
  SMTP.Subject = "This is the subject"
  SMTP.Body = "This is the message body."
  'SMTP.AddAttachment(File.DirRootExternal, "somefile")
  SMTP.Send
End Sub
Sub SMTP_MessageSent(Success As Boolean)
  Log(Success)
  If Success Then
    ToastMessageShow("Message sent successfully", True)
  Else
    ToastMessageShow("Error sending message", True)
    Log(LastException.Message)
  End If
End Sub

The mail was sent error.

Error message is .

java.lang.RuntimeException: Empty writer returned: 503 5.5.2 Send hello first [HKAPR04CA0014.apcprd04.prod.outlook.com]

what else do I need to do?
 
Solution
Just I updated the Net libaray from 1.53 to 1.81,
Now the error message is org.apache.commons.net.smtp.SMTPConnectionClosedException: Connection closed without indication.

teddybear

Well-Known Member
Licensed User
Just I updated the Net libaray from 1.53 to 1.81,
Now the error message is org.apache.commons.net.smtp.SMTPConnectionClosedException: Connection closed without indication.
 
Upvote 0
Solution
Top