I am trying to send email via classic asp but it gives me below error.
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.
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.