Le transport a échoué dans sa connexion au serveur
Fermé
abderrahim1234
Messages postés
6
Date d'inscription
jeudi 5 décembre 2019
Statut
Membre
Dernière intervention
11 décembre 2019
-
Modifié le 11 déc. 2019 à 15:40
jordane45 Messages postés 37253 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 17 mars 2023 - 11 déc. 2019 à 21:13
jordane45 Messages postés 37253 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 17 mars 2023 - 11 déc. 2019 à 21:13
1 réponse
jordane45
Messages postés
37253
Date d'inscription
mercredi 22 octobre 2003
Statut
Modérateur
Dernière intervention
17 mars 2023
4 551
11 déc. 2019 à 20:12
11 déc. 2019 à 20:12
Bonjour,
A l'avenir, merci d'utiliser les BALISES DE CODE.
Voici un code qui devrait fonctionner
A l'avenir, merci d'utiliser les BALISES DE CODE.
Voici un code qui devrait fonctionner
Public Function send_email()
Set cdomsg = CreateObject("CDO.message")
With cdomsg.Configuration.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'NTLM method
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smptserverport") = 587
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "mygmail@gmail.com"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mypassword"
.Update
End With
' build email parts
With cdomsg
.To = "somebody@somedomain.com"
.From = "mygmail@gmail.com"
.Subject = "the email subject"
.TextBody = "the full message body goes here. you may want to create a variable to hold the text"
.Send
End With
Set cdomsg = Nothing
End Function
Modifié le 11 déc. 2019 à 20:39
Je veux essayer, mais qui ne marche pas Dans mon code.
11 déc. 2019 à 21:13
As tu utilisé ton mot de passe de ton gmail, ou, comme recommandé un mot de passe d'application ?
Regarde ceci : https://support.google.com/accounts/answer/185833