Senden Sie E-mail mit CDO durch Google Apps ermöglicht den transport error: CDO.Nachricht.1 Fehler '80040213'
Ich versuche zu senden Sie eine Kontakt-Anfrage-E-Mail von einem legacy-classic asp-Skript mit einem Google Apps-Konto als das SMTP-server. Den code habe ich um dies zu testen, ist wie folgt:
Dim ObjSendMail
Set ObjSendMail = CreateObject("CDO.Message")
'This section provides the configuration information for the remote SMTP server.
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="mail.thedomain.com"
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465 ' or 587
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
' Google apps mail servers require outgoing authentication. Use a valid email address and password registered with Google Apps.
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="[email protected]" 'your Google apps mailbox address
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="password" 'Google apps password for that mailbox
ObjSendMail.Configuration.Fields.Update
ObjSendMail.To = "[email protected]"
ObjSendMail.Subject = "this is the subject"
ObjSendMail.From = "[email protected]"
' we are sending a text email.. simply switch the comments around to send an html email instead
'ObjSendMail.HTMLBody = "this is the body"
ObjSendMail.TextBody = "this is the body"
ObjSendMail.Send
Set ObjSendMail = Nothing
Habe ich versucht, sowohl die port-Nummern 465 und 587. Ich habe versucht, mail.thedomain.com und smtp.thedomain.com und mail.gmail.com und smtp.gmail.com als SMTP-server, aber nichts funktioniert. Ich habe protokolliert, in das Google Apps-Konto mit der E-Mail-Adresse und Ihr Passwort in das Skript, so dass diejenigen, die Angaben sind definitiv korrekt.
Alles, was bekomme ich jedoch die folgende Fehlermeldung:
CDO.Message.1 error '80040213'
The transport failed to connect to the server.
/_test-email.asp, line 46
(Linie 46, wo es heißt ObjSendMail.Senden)
Kann jemand sehen, was falsch sein könnte?
Vielen Dank Leute!
- beenden der Bearbeitung aller Fragen in der gleichen Art und Weise...
Du musst angemeldet sein, um einen Kommentar abzugeben.
Habe ich versucht mit Gmail smtp-server und eine kleine änderungen an Ihrem code und es funktionierte wie ein Charme.
Ändern Sie einfach diese 3 Parameter, und Sie sind gut zu gehen.
Versuchen Sie
smtpusessl
zu1
(wahr) (ich sehe, Sie haben es eingestellt, umfalse
)smtpserver = "smtp.gmail.com", smtpserverport = 465, smtpusessl = 1
und es funktionierte perfekt. wenn es immer noch nicht funktioniert, es würde vorschlagen, ein firewall-Problem auf Ihrem Ende?