Classeur
p
Bonjour
J ai un fichier avec une macro qui envoi un mail en cdo, il marche sur mon ordinateur mais au boulot celui ci me dit erreur 80040213 erreur de serveur, je pense que c verrouille avec un proxi.
Que me conseillez vous de faire ?
L idee de ce tableau m avertit a date dépassée par mail.
Merci
Bonjour,
il faut renseigner ces lignes avec les valeurs du serveur de ton boulot
With flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "relais.videotron.ca"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "moi@videotron.ca"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "MonPassWord"
.Update
End With
p
Voila le code qui marche chez moi j ai la meme chose
sauf le relais ect.
With mChps
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Adapter suivant votre serveur de mail. (exemple pour Gmail.)=> Hormail "smtp.live.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
'En principe, 25 fonctionne avec tout les serveurs.
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = "465"
'Vous pouvez essayer sans ces trois lignes
'Mais si votre serveur demande une authentification,
If [E6].Value <> "" Then
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = "1"
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = ************@gmail.com"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "**********************"
End If
'Si votre serveur demande une connexion sûre (SSL)
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = "true"
.Update
End With
Set mMessage = CreateObject("CDO.Message")
With mMessage
Set .Configuration = mConfig
.To = "*******************@hotmail.com"
.From = ***************************@gmail.com"
.CC = "***********************@gmail.com"
.Subject = "ALERTE CONTRAT DE MAINTENANCE"
.TextBody = "ETEINT ALERTE UN CONTRAT DE MAINTENANCE DE L'ENTREPRISE " & Range("C" & cel.Row) & " DU CONTRAT " & Range("D" & cel.Row) & " A LA DATE DU " & Range("E" & cel.Row) & " ARRIVE A ECHEANCE "
'Pour ajouter une pièce jointe, un fichier, classeur, image etc.
'.AddAttachment 'Chemin et nom complet du fichier à joindre
.send
End With