简体   繁体   English

asp.net发送电子邮件时出错

[英]Error asp.net sending email

I followed the first answer of How can I send email using Gmail SMTP in asp.net mvc application? 我遵循了如何在asp.net mvc应用程序中使用Gmail SMTP发送电子邮件的第一个答案 and i tried another tutorials but same result(i used my gmail account and password). 我尝试了另一个教程,但结果相同(我使用了我的Gmail帐户和密码)。 I receive error when it is doing smtp.Send(message); 我在执行smtp.Send(message);时收到错误; I receive error 502 ( Bad GateWay) 我收到错误502(错误的GateWay)

There are two forms of SMTP over SSL; 基于SSL的SMTP有两种形式: Explicit SSL and Implicit SSL. 显式SSL和隐式SSL。 You need to determine which form of SSL your destination server is using, and make sure that the SMTP library you are using supports that protocol and is configured properly. 您需要确定目标服务器正在使用哪种形式的SSL,并确保所使用的SMTP库支持该协议并且配置正确。

I would also suggest that instead of sending email directly within your ASP.Net code, that you queue the messages to a database, and have a service that routinely checks the queue and sends messages, and only removes messages upon successful send. 我还建议您不要在ASP.Net代码中直接发送电子邮件,而是将消息排队到数据库中,并提供一项服务来例行检查队列并发送消息,并仅在成功发送后才删除消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM