SMTP Error sending email 5.2.0 SendAsDeniedException with Office365

Hello,

I searched the forum and I do not see any error like the one that appears in NAV.

I have configured my Office365 account on the SMTP page and when I push send test emails button and send it to the same email address that i configured, no error appears. But if I push the test button again and send it to other address I get the error that I attached below (5.2.0 STOREDRV.Submission.Exception: SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message Can not submit message).

g5adpgetcba9.jpg

Other times I solved the error by changing the Office365's password account for a new one, but I do not know if this temporary solution is correct or we need to configure something else.

Can we do something else?
Thanks for everything.

Answers

  • nav_studentnav_student Member Posts: 175
    Did you try from Powershell?

    Open it as an Administrator and use the following command
    Send-MailMessage –From user1@domain.com –To user2@domain2.com –Subject “Test Email” –Body “Test SMTP Relay Service” -SmtpServer smtp.office365.com -Credential $msolcred -UseSsl -Port 587
    
    Does it work?

    which version are you using?
    On NAV2016 when you click Test Email Setup (SMTP Mail Setup) I believe the FromAddress and the SenderAddress are the same which it doesn't make any sense and then generates the error message that you sent. You could confirm it using the debugger.

    On NAV2018 the message is different. Only asks for the SenderAddress which makes more sense. Because it will pick up FromAddress from the SMTP Mail Setup
    Choose the email address that should receive a test email message:
  • DamjanDamjan Member Posts: 94
    Hi
    I have the same error in NAV2013 R2,
    I do not have the error if I use BC SaaS, but field: "Allow Sender Substitution" is flagged on SMTO

    I'm thinking to support same also in NAV2013 R2. Or you have any other solution?

    Thanks, Damjan
  • DamjanDamjan Member Posts: 94
    Hi,
    we have same issue on NAV2013 R2, as we switched to Office365.

    I have noticed that user account which is being configured on SMTP Mail Setup, has set license type Exchange Kiosk, and I am not sure, if this can be the cause.

    I noticed it works fine if I configure same office365 account in SMTP Mail setup of BC SaaS...

    thanks Damjan
  • edoderooedoderoo Member Posts: 89
    A trick we did back then, when customers moved to Office 365:
    Install a local mailserver, that will forward all mail to Office 365... and use the local mailserver in the NAV-setup. Ask the IT-ppl if they can set this up for you.
    IF User.Loves('Edo') THEN ok() ELSE currReport.genSkip;
  • DamjanDamjan Member Posts: 94
    can you be more specific on local mailserver. We have only Office365 and we do not really want to have any local servers, that is why we moved to Office365...
  • edoderooedoderoo Member Posts: 89
    it is actually only an smtp-server that you need that can be installed on any local server in your network. As it will forward all mail to the Office365 mailserver, it doesn't even need internet access.
    The issue is that old NAV instances can not deal with the new minimum safety requirements of Office365. Three years ago we had several customers that moved overnight to Office365 without testing or notifying us as NAV dealer, especially the NAV2009-customers had huge issues, as email was sent by old DotNet-components.

    But the error you get, says "not allowed to send-as". Maybe the system-administrator can whitelist your send-as mail address on the server?
    IF User.Loves('Edo') THEN ok() ELSE currReport.genSkip;
Sign In or Register to comment.