SMTP服务器需要安全连接还是客户端未经过身份验证?

问题描述:

SMTP服务器需要安全连接,或者客户端未经过身份验证。服务器响应为:5.5.1需要身份验证。了解更多信息



The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at

MailMessage Msg = new MailMessage();
           SmtpClient Smtp = new SmtpClient();
           EmailID = txtEmailID.Text.Trim();
           Msg.From = new MailAddress("PrasadAnumolu999@gmail.com");
           Msg.To.Add(EmailID);
           Msg.Subject = "Please Confirm You Activation Link";
           ActivationURL = Server.HtmlEncode("http://localhost:2759/EmailVarification.aspx" + "&EmailID=" + EmailID);
           Msg.Body="Hi" +txtEmailID.Text.Trim() +"!\n" +
               "Thanks For You Interest For Visiting My Web Site <a href='http://stuffuser.blogspot.in/'> STUFFUSER.in</a>" +
                        " Please <a href='" + ActivationURL + "'>click here to activate</a>  your account and enjoy our services. \nThanks!";

           Msg.IsBodyHtml = true;
           Smtp.Port = 25;
           Smtp.Host = "Smtp.Gmail.com";
           Smtp.EnableSsl = true;
           Smtp.Credentials = new NetworkCredential("PrasadAnumolu@gmail.com", "sai!#%&(99");
           Smtp.Send(Msg);

如果这是您的实际密码,您可能需要将其删除!!



我还建议您检查端口设置.25很少用于ssl连接。

我认为gmail可能是465?
If that is your actual password you may want to remove it!!

I would also advise that you check the port setting. 25 is rarely used for ssl connections.
I think gmail may be 465?