Skip to content

Need help in Sending E-mail Via .Net

Hilbert

Asked Jan 17, 2008, 8:54 AM EST1 answer
Share
LinkedInX
Hello Friends,
                       When I tried to send an E-mail through .Net using the following code,
           MailMessage msg = new MailMessage("[email protected]","[email protected]","VS2008 Mail","VS2008 Mail Check");
         
               SmtpClient client = new SmtpClient("smtp.mail.yahoo.com");

             client.Send(msg);

          I got a message as below:

             "The Smtp Server requires a secure connection or the client was not Authenticated...."

              Then it Exits! Can any one of you help me in sorting out this problem.

                                                      Thank You in Advance!
                                                                                                                                                                         Sincerely,
                                                                                                                                                                         V.Hilbert
      
                   

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Niradhip Chakraborty
    0
    If you're sending email through an SSL SMTP like GMail, then you have to set the SmtpClient.EnableSsl to True.  About the only way to do this is to override the email functionality of CreateUserWizard.  Use the SendingMail event method to define your MailMessage and SmtpClient and then use the Cancel property to prevent the CreateUserWizard from sending its automated email.
    0