SMTP Mail Error - Requires Client Authentication

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeff

    SMTP Mail Error - Requires Client Authentication

    I am receiving the following error:

    // error: System.Net.Mail .SmtpException: The SMTP server requires a
    secure connection or the client was not authenticated. The server
    response was: 5.7.0 No AUTH command has been given.

    How do I provide the Client Authentication with the code below.


    private void SendEmail2()
    {
    /* create the email message */
    MailMessage message = new mailMessage("jw ill@domain.com" ,
    "test@domain.co m","Test email " +
    DateTime.Today. ToString(),"bod y fo the message " );

    /* create SMTP Client and add credentials */
    SmtpClient smtpClient = new SmtpClient("smt p.domain.com");

    /* Email with Authentication */
    smtpClient.Cred entials = new NetworkCredenti al("jwill",
    "abcdef");
    smtpClient.UseD efaultCredentia ls = false;
    /*Send the message */
    smtpClient.Send (message);

    // error: System.Net.Mail .SmtpException: The SMTP server requires a
    secure connection or the client was not authenticated. The server
    response was: 5.7.0 No AUTH command has been given.
    }
  • sloan

    #2
    Re: SMTP Mail Error - Requires Client Authentication

    Go here
    http://sholliday.space s.live.com/Blog/cns!A68482B9628 A842A!138.entry

    download the code..and you can tweak the settings as needed....




    "Jeff" <jeff@[_nospam_].hardsoft.com.a uwrote in message
    news:13s7pddmr1 1pj85@corp.supe rnews.com...
    >I am receiving the following error:
    >
    // error: System.Net.Mail .SmtpException: The SMTP server requires a secure
    connection or the client was not authenticated. The server response was:
    5.7.0 No AUTH command has been given.
    >
    How do I provide the Client Authentication with the code below.
    >
    >
    private void SendEmail2()
    {
    /* create the email message */
    MailMessage message = new mailMessage("jw ill@domain.com" ,
    "test@domain.co m","Test email " + DateTime.Today. ToString(),"bod y fo
    the message " );
    >
    /* create SMTP Client and add credentials */
    SmtpClient smtpClient = new SmtpClient("smt p.domain.com");
    >
    /* Email with Authentication */
    smtpClient.Cred entials = new NetworkCredenti al("jwill",
    "abcdef");
    smtpClient.UseD efaultCredentia ls = false;
    /*Send the message */
    smtpClient.Send (message);
    >
    // error: System.Net.Mail .SmtpException: The SMTP server requires a secure
    connection or the client was not authenticated. The server response was:
    5.7.0 No AUTH command has been given.
    }

    Comment

    Working...