简体   繁体   English

通过经典ASP发送电子邮件时出错:

[英]Error via sending email through classic asp:

I am trying to send email via classic asp but it gives me below error. 我正在尝试通过经典的ASP发送电子邮件,但它给了我下面的错误。

CDO.Message.1 error '80040213' The transport failed to connect to the server. /hotemp/regnew.asp, line 507

Initially it was working fine , suddenly it gives the above error. 最初它工作正常 ,突然出现上述错误。 I googled but it didn't help. 我用谷歌搜索,但没有帮助。 Any suggestions on how to get over this. 关于如何解决这个问题的任何建议。 Thank you 谢谢

My code below: 我的代码如下:

<%

 Set Mail = CreateObject("CDO.Message")

    Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="smtp.gmail.com"
Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465

Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1

Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60

Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="myemail@gmail.com"
Mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="password"

Mail.Configuration.Fields.Update

Mail.Subject="Sending via classic asp"
Mail.From="abcdef@gmail.com"
Mail.To="wxyz@gmail.com"

Mail.TextBody="please fill the form" 
Mail.Send      ` line 507
Set Mail = Nothing

%>

Usually when code starts off working fine and then fails without any changes to the code being made, it's the result of something changing on the server. 通常,当代码从正常工作开始,然后在没有对代码进行任何更改的情况下失败时,这是服务器上某些更改的结果。

I would hazard a guess that you've been sending either too many emails, or that gmail thinks your messages are a little spammy and has stopped accepting connections. 我可能会猜测您发送的电子邮件过多,或者gmail认为您的邮件有点垃圾并且已停止接受连接。

Usually when sending email from a web app like this, you're better off using the mail server your host provides you or signing up with a service that offers this sort of thing. 通常,当从这样的Web应用程序发送电子邮件时,最好使用主机为您提供的邮件服务器或注册提供此类服务的服务。

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

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