+1 vote

Hello,

See error below based upon code:

ISendMessageResult result = smtp.SendMessage(email);

554 5.2.0 STOREDRV.Submission.Exception: SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message Cannot submit message. [Hostname=CH2PR18MB3175.namprd18.prod.outlook.com]

Thanks!

by (450 points)

1 Answer

0 votes
 
Best answer

This error comes from your SMTP server (not Mail.dll itself).

I think this error coming from outlook.com means that the user whose credentials you specified in the SMTP connection cannot submit messages on behalf of the user specified in the From/Sender MIME headers -or- the FROM SMTP command.

You should be using the same from (MailBuilder.From) for your message as you use in logging in (Smtp.UseBestLogin).

by (297k points)
selected by
...