Server not support secure connections?!

 Hi,

I am getting the following error message:

Server does not support secure connections.

When trying to send e-mails from my code-behind.

Here is the guilty code:

    protected void CreateUserWizard2_ContinueButtonClick(object sender, EventArgs e)
    {



        StringBuilder bodyMsg = new StringBuilder();
        TextBox Username = (TextBox)CreateUserWizard2.CreateUserStep.ContentTemplateContainer.FindControl("UserName");
        TextBox EMail = (TextBox)CreateUserWizard2.CreateUserStep.ContentTemplateContainer.FindControl("Email");



        bodyMsg.Append("\n\n Thank you for creating your new account.Your new account has been created with the following username:");
        bodyMsg.AppendFormat("\nUserName: {0}", Username.Text);



        NetworkCredential loginInfo = new NetworkCredential("postmaster@MYSITE.com", "PASSWORD");
        MailMessage msg = new MailMessage();
        msg.From = new MailAddress("postmaster@MYSITE.com");
        msg.To.Add(new MailAddress(EMail.Text));
        msg.Subject = "SUBJECT";
        msg.Body = bodyMsg.ToString();
        msg.IsBodyHtml = false;

        SmtpClient client = new SmtpClient("mail.MYSITE.com", PORT NUM);
        client.EnableSsl = true;
        client.UseDefaultCredentials = false;
        client.Credentials = loginInfo;
        client.DeliveryMethod = SmtpDeliveryMethod.Network;
        client.Send(msg);

        Response.Redirect("../thankyou.aspx");



    }

Now, unless someone more knowledgeable says other-wise, I have a suspicion the error is caused because my server required authentication (or atleast it does for outlook express). Could this be the reason? If so, how to I solve the issue?

If not, what could be causing the error?

Thanks!

Jon

 

0
jbear123
1/14/2008 8:17:57 PM
asp.net.getting-started 91979 articles. 2 followers. Follow

2 Replies
309 Views

Similar Articles

[PageSpeed] 43

You have:
client.EnableSsl = true;

Are you sure this is the case? Try removing this or setting it to FALSE once, as a test....


0
Curt_C
1/14/2008 10:13:05 PM

Yes sorry. Made the assumption and stuck with it! Thanks for your help! 

0
jbear123
1/14/2008 10:56:23 PM
Reply: