Sending email using Smtp.mail.microsoftonline.com

后端 未结 5 1908
梦如初夏
梦如初夏 2021-01-04 12:28

The context:

We’re a small company that does not have an Exchange Server (or anyone dedicated to it) yet we still need to have/send emails.

5条回答
  •  春和景丽
    2021-01-04 13:07

    looking in Reflector on UseDefaultCredentials property, you can see that it also changes the trasnport.Credentials value, so when you called this property with a false value, it changed the transport credentials to null. the problem is that you called this property after setting the credentials in the line before that, it nullified the credentials.

    so bottom line, you shouldn't set the credentials and call this property afterwise.

提交回复
热议问题