Envoyer de mail avec des CDO par le biais de Google Apps permet le transport d'erreur: CDO.Message.1 erreur '80040213'

Je suis en train d'envoyer une demande de contact e-mail à partir d'un héritage classique asp script à l'aide d'un compte Google Apps comme serveur SMTP. Le code que je dois tester ce est comme suit:

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 

J'ai essayé les deux numéros de port 465 et 587. J'ai essayé mail.thedomain.com et smtp.thedomain.com et mail.gmail.com et smtp.gmail.com comme serveur SMTP, mais rien ne fonctionne. Je me suis connecté sur le compte Google Apps avec votre adresse email et mot de passe dans le script, de sorte que ces détails sont certainement correctes.

Tout ce que je peux obtenir de bien est le message d'erreur suivant:

CDO.Message.1 error '80040213'

The transport failed to connect to the server.

/_test-email.asp, line 46 

(ligne 46 est où il est dit ObjSendMail.Envoyer)

N'importe qui peut voir ce qui ne va pas?

Merci les gens!

  • arrêter la modification à toutes les questions de la même manière...
InformationsquelleAutor Dan | 2012-03-12