.NET SmtpClient - анонимная аутентификация


: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/users/d/dm9/domains/mokshin.su/includes/unicode.inc on line 311.

Для анонимной аутентификации (точнее - чтобы ее не было вообще) нужно:

  • установить свойство UseDefaultCredentials = False
  • не назначать значение свойству Credentials (т.е. должно быть null для C#, или Nothing для VB)

Об этом что-то нигде явно не упоминается. Кроме как в msdn ;-) :

If the UseDefaultCredentials property is set to false and the Credentials property has not been set, then mail is sent to the server anonymously.

И лезут всякие ошибки типа таких:


    The server committed a protocol violation The server response was: UGFzc3dvcmQ6
    Syntax error in parameters or arguments. The server response was: Unknown command

Нравится