Pb d'envoi mail via VBA EXCEL 2010
Bonjour,
le code suivant ne fonctionne pas.
J'ai fouillé sur différents forums et testé moultes codifications de paramètres, je ne trouve pas la bonne solution pour envoyer un mail via WANADOO.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| ' Envoi du mail
Set mConfig = CreateObject("CDO.Configuration")
Set mChps = mConfig.Fields
With mChps
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.wanadoo.fr"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = "587"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = "1"
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "xxxxxxxx.wanadoo.fr"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "motdepasse"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = "true"
.Update
End With
Set mMessage = CreateObject("CDO.Message")
With mMessage
Set .Configuration = mConfig
.To = MailDesti
.CC = MailDest2
If MailCopie = "O" Then
.BCC = ServeurUtil ' en copie cachée
Else
.BCC = "" ' pas de copie cachée
End If
.From = ServeurUtil
.BodyPart.Charset = "iso-8859-1"
.Subject = MailTitre
.TextBody = MailCivil & vbCrLf & vbCrLf & _
MailText1 & vbCrLf & _
MailText2 & vbCrLf & _
MailText3 & vbCrLf & vbCrLf & _
MailSalut & vbCrLf & _
MailSigne
.AddAttachment MailPiece
.Send
End With |
J'obtiens une "erreur d'exécution -2147220973 le transport a échoué dans sa connexion au serveur".
Auparavant j'étais sur YAHOO : pas de souci. Tout fonctionnait super bien.
Avez-vous une idée de mon erreur ?
Meric
Cdt
Daniel