本文介绍了SMTP服务器要求安全连接或客户端未通过身份验证。如果上传的GoDaddy的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
低于code是工作在当地罚款,但如果上传上传它的godaddy它不工作。
错误:显示
Line 53:
Line 54: smtp.EnableSsl = true;
Line 55: smtp.Send(message);
Line 56:
Line 57:
plz check below code
MailMessage message = new MailMessage();
message.From = new MailAddress(emailid.Text);
message.To.Add(new MailAddress("[email protected]"));
message.Subject = "NaatKhawan's Feedback";
message.Body = "Selected: " + DropDownList1.Text.ToString() + "<br/><br/>Name: " + name.Text.ToString() + " <br/><br/>Email: " + emailid.Text.ToString() + " <br/><br/>Contact Number: " + phone.Text.ToString() + " <br/><br/>Message:<br/> " + remabox.Text.ToString();
message.IsBodyHtml = true;
// finaly send the email:
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.Port = 587;
smtp.Credentials = new System.Net.NetworkCredential("[email protected]", "123");
smtp.EnableSsl = true;
smtp.Send(message);
lbltxt.Visible = true;
name.Text = "";
emailid.Text = "";
phone.Text = "";
remabox.Text = "";
lbltxt.Text = "Thank you for supporting NaatKhawan";
解决方案
you should enable application to access gmail account. This link will help you
这篇关于SMTP服务器要求安全连接或客户端未通过身份验证。如果上传的GoDaddy的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!