Archive for July, 2020

h1

Is From Name Case Sensitive with Office 365 SMTP?

July 15, 2020

Something to watch.  I’m connecting to an Office365 server through SMTP and setting a “From Name” for an email.  It’s something I had setup a number of times before, so I surprised when today when I got this error message:

Error sending message Transaction failed. The server response was: 5.2.0 STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message Cannot submit message.

at System.Net.Mail.DataStopCommand.CheckResponse(SmtpStatusCode statusCode, String serverResponse)
at System.Net.Mail.DataStopCommand.Send(SmtpConnection conn)
at System.Net.ClosableStream.Close()
at System.Net.Mail.SmtpClient.Send(MailMessage message)

 

I compared with other situations doing the same thing and I noticed a difference in the casing of the From Name.  Where I was getting the error, I was using capital letters in the domain (“MyUserName@MyCompany.com”).  But the places that were working had the domain in all lower cases (“MyUserName@mycompany.com”).

I changed the casing of my From Name and then it started working.  Coincidence?  Documenting just in case I need this idea again.  🙂