C # When sending a message: "The mailbox name is not allowed. Server response: "Error resolution

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.