Hello, We created a New report and wrote the attached Code to send Email certain data to one user.
Attached is the SMTP setting on our NAV server.
However, we executed the report, we got the error
Microsoft Dynamics NAV
The SMTP mail system returned the following error: "The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM [KL1PR0601CA0015.apcprd06.prod.outlook.com]".
Answers
Try set the sender in SMTP.Message() to NAV_Notification[what's behind red box] to test if can can send at all. if success then set up permissions to send as or send on behalf in office365
Yes, here is the code that we wrote, and we rae taking sender from SMTP setup,
if i replace NAV_Notifications@abc.com to myname@abc.com in SMTP setup and update my password, this works. but how this NAV_notifications is able to send PO and SO approval emails within NAV and not like this?
The password is correct, because when I test nav_notification from SMTP setup using test email setup and send email to itself i.e. nav_notification it's working but when I choose other and give some other email address, it fails. But how this particular id Nav_notification is able to send Purchase orders/Sales Orders approval and rejection notifications to users. Also, when I Use my Id on SMTP setup and try to send mail using Test Email setup to any other address, that also fails, but using the code it works.
This is resolved. Instead of using SMTP user ID(which is actually an office 365 EMail ID), i use a User id from User setup whose email is SMTP UserID.
I found the following posts, has anyone experience with these?
https://www.hougaard.com/wysiwyg-editing-control-for-dynamics-nav-2013-and-2015/
https://mibuso.com/downloads/pawnhtmltexteditor-v1.2
Do you have any suggestions?