-
John Murphy
- PowerBuilder
- Friday, 21 August 2026 06:52 PM UTC
My customer wants to use 2-factor authentication because of an email problem. When I turn it on for me. I get the following error:
535.5.7.139 Authentication unsuccessful, the request did not meet the criteria to be authenticated successfully.
It using Outlook in Office365 on the web.
The application is currently running in PB2019 -- I did test upgrade it to PB2025 and get the same results.
I cut a bunch of stuff out of the function but I think I left the relevant parts.
Any ideas?
n_pbnismtp ln_smtp
// set message properties
ln_smtp.SetSenderEmail(ls_sender)
ln_smtp.SetRecipientEmail(ls_recipient)
ln_smtp.SetBCCRecipientEmail(ls_sender)
ln_smtp.SetSubject(as_subject)
ln_smtp.SetMessage(ls_body, lb_html)
// send the email
Try
ll_status = ln_smtp.Send()
catch ( NullObjectError noe )
f_message_box("Null Object Exception", noe.getMessage())
Return -1
catch ( PBXRuntimeError pbxre )
f_message_box("PBX Exception", pbxre.getMessage())
Return -2
catch ( Throwable oe )
f_message_box("Other Exception", oe.getMessage())
Return -3
finally
If ll_status = 1 Then
f_message_box("works", "Message Sent!")
Else
ls_errmsg = ln_smtp.GetLastErrorMessage()
f_message_box( "Mail Error: " + String(ll_status), ls_errmsg)
Return -4
End If
end try
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.