Because of the project needs, to provide customers with a regular mail-sending program. Originally wrote, but the new program did not pass the test one night, always prompt "not allowed to use the mailbox name." Server response to ... "
After searching the web for solutions, it seems that the solution is one, which is to put SMTP. useDefaultCredentials = true; writes to SMTP. Credentials = new NetworkCredential ("MyUserName", "MyPwd");
However, using this method does not resolve the issue.
Later, I start from the mailbox settings, found that most of the mailboxes are now used to set the SMTP email and client authorization code of the dual function, take 126 as an example, in the 126 mailbox page version of the settings, you can see, such as
Later, I will SMTP. The mypwd in Credentials = new NetworkCredential ("MyUserName", "MyPwd") was replaced with my client authorization code and passed the test immediately.
I hope that my friends will encounter this kind of problem also more a solution.
C # When sending a message: "The mailbox name is not allowed. Server response: "Error resolution