asp .net中的smtp邮件C# [英] smtp mail in asp .net C#
本文介绍了asp .net中的smtp邮件C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
HI
我在hotmail和rediffmail发送smtp邮件并收到错误
SMTP服务器需要安全连接或客户端未经过身份验证。服务器的响应是:5.7.0必须发出STAR
如何解决这个错误。 ....
plz halp me ..
HI
I am send the smtp mail in hotmail and rediffmail and get error
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STAR
how to solved this error.....
plz halp me..
推荐答案
有两种可能性。第一个是未启用SSL。添加以下行:
Hi,
There're two possibilities. The first one is that SSL isn't enabled. Add this line:
yourSmtpClient.EnableSsl = true; // if this line is added already, you don't need to add it a second time
第二种可能性是您没有提供凭据。添加以下行:
The second possibility is that you didn't provide credentials. Add this line:
yourSmtpClient.Credentials = new System.Net.NetworkCredential("yourUsername@example.com", "yourPassword"); // if this line is added already, you don't need to add it a second time
希望这有帮助。
Hope this helps.
亲爱的先生
i有这个代码
dear sir
i have this code
MailMessage oMail = new MailMessage();
oMail.From = new MailAddress("pktripathi1987@gmail.com");
oMail.To.Add("pktripathi1987@gmail.com");
oMail.Subject = "Contact Form";
oMail.Body = body;
oMail.IsBodyHtml = true;
oMail.Priority = MailPriority.High;
SmtpClient SmtpMail = new SmtpClient();
SmtpMail.Host = "smtp.live.com";
// SmtpMail.Port = int.Parse(port);
SmtpMail.EnableSsl = true;
SmtpMail.DeliveryMethod = SmtpDeliveryMethod.Network;
SmtpMail.UseDefaultCredentials = false;
SmtpMail.Credentials = new System.Net.NetworkCredential("Email@hotmail.com", "pass");
SmtpMail.Send(oMail);
oMail.Dispose();
return "1";
但收到错误
but get error
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STAR
这篇关于asp .net中的smtp邮件C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文