连接尝试失败-Smtp.asp.net mvc中发送

努鲁·萨利胡(Nuru Salihu)

我已经尝试发送消息已有一段时间了。但是Stmp.send失败并给出了错误。

连接尝试失败,因为一段时间后连接方未正确响应,或者建立的连接失败,因为连接的主机未能响应202.71.99.194:25

 System.Net.Mail.MailMessage m = new System.Net.Mail.MailMessage(
                             new System.Net.Mail.MailAddress("[email protected]", "Web Registration"),
                             new System.Net.Mail.MailAddress(user.Email));
                    m.Subject = "Email confirmation";
                    m.Body = string.Format("Dear {0}<BR/>Thank you for your registration, please click on the below link to comlete your registration: <a href=\"{1}\" title=\"User Email Confirm\">{1}</a>", user.Username, Url.Action("ConfirmEmail", "Account", new { Token = user.Id, Email = user.Email }, Request.Url.Scheme));
                    m.IsBodyHtml = true;
                    System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("smtp.google.com");
                    smtp.Port = 587;
                    smtp.EnableSsl = true;
                    smtp.UseDefaultCredentials = false;
                    smtp.Credentials = new System.Net.NetworkCredential("[email protected]", password);

                    smtp.Send(m);

我禁用了防病毒软件,但尝试全部失败。请问我哪里出错了?任何帮助,将不胜感激。

萨里夫

选中“端口/防火墙/防病毒”,然后更改安全应用程序设置。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

使用smtp服务器,asp.net的电子邮件发送失败

如何在ajax post请求asp.net core mvc razor中发送对象数组

在ASP.NET MVC中发送电子邮件后,jQuery Ajax不会返回警报

ASP.NET MVC 4-ListBoxFor,在ActionLink中发送selectedValue

使用SmtpClient和Mandrill SMTP的.NET发送失败

无法在ASP.NET中发送邮件?

MONO / .NET 4-ASP.NET使用Google SMTP从页面发送电子邮件

ASP.NET MailKit SMTP响应

asp.net中的Gmail SMTP错误

使用Gmail SMTP OAUTH从asp.net发送电子邮件

ASP.NET通过1and1 SMTP发送电子邮件

如何在ASP.NET MVC中发送带有GET请求的Content-Type标头?

在asp.net mvc中发送电子邮件,而无需像在php中那样使用凭据

PopUp 不在 ASP.NET MVC 5 和实体框架中的数据库中发送数据

电子邮件不会在MVC中发送,但可以在ASP.NET Web窗体中使用

smtp异常“发送邮件失败”

在yii中发送smtp邮件

尝试添加或编辑项目时,Kendo UI ASP.NET MVC ListView失败

ASP:JMail的SMTP身份验证失败

在Hiox中的asp.net中发送邮件

如何定义发布请求中发送的内容(ASP.NET)

在实时Asp.net应用程序中发送文件

使用ssl运行asp.net mvc应用程序时安全连接失败

尝试在RoR应用程序中发送电子邮件时遇到SMTP错误

net / smtp是否以纯文本发送凭据?

附件不发送ASP.NET MVC

ASP.NET C#-从Gmail / Yahoo Live SMTP服务器发送电子邮件不起作用

Net :: SMTP在Windows 8上无法连接

连接到设备ASP.NET MVC