Merci de votre aide
Voici 3 fois le même programme (ou presque)
pourquoi le 3ieme ne fonctionne pas ?
Celui-ci fonctionne (avec le port 25 sur free.fr)
Celui-ci fonctionne aussi très bien avec port 465 et le smtp de orange
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 Sub DEMO_EnvoiMailCDO_JLM25() Dim mMessage As Object Dim mConfig As Object Dim mChps Set mConfig = CreateObject("CDO.Configuration") mConfig.Load -1 Set mChps = mConfig.Fields With mChps .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.free.fr" .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 .Update End With Set mMessage = CreateObject("CDO.Message") With mMessage Set .Configuration = mConfig .From = "jl.martinu@orange.fr" .To = "jeanlomaau@free.fr" .Subject = "Le sujet du mail" .TextBody = "Ce mail vous est envoyer pour tester la macros de Jlouis" 'Pour ajouter une pi?ce jointe, un fichier, classeur, image etc. '.AddAttachment 'Chemin et nom complet du fichier ? joindre .Send End With Set mMessage = Nothing 'Lib?re les ressources Set mConfig = Nothing Set mChps = Nothing End Sub
Enfin, celui-ci ne fonctionne pas pourquoi ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
38
39
40
41 Sub DEMO_EnvoiMailCDO_JLM465() Dim mMessage As Object Dim mConfig As Object Dim mChps Set mConfig = CreateObject("CDO.Configuration") mConfig.Load -1 Set mChps = mConfig.Fields With mChps .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.orange.fr" .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465 .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = "1" .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "jl.martin@orange.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 .From = "jl.marti@orange.fr" .To = "jeanloneau@free.fr" .Subject = "Le sujet du mail" .TextBody = "Ce mail vous est envoyer pour tester la macros de Jlouis orange port 465" 'Pour ajouter une pi?ce jointe, un fichier, classeur, image etc. '.AddAttachment 'Chemin et nom complet du fichier ? joindre .Send End With Set mMessage = Nothing 'Lib?re les ressources Set mConfig = Nothing Set mChps = Nothing End Sub
On me dit que le mail dans cette entreprise est :
Nom de serveur : smtp.office365.com
Port : 587
Méthode de chiffrement : STARTTLS
Il me répond :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
38
39
40
41 Sub DEMO_EnvoiMailCDO_GL() Dim mMessage As Object Dim mConfig As Object Dim mChps Set mConfig = CreateObject("CDO.Configuration") mConfig.Load -1 Set mChps = mConfig.Fields With mChps .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.office365.com" .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") = "gare@exedra.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 .From = "gare@exedra.fr" .To = "jeeau@free.fr" .Subject = "Le sujet du mail" .TextBody = "Ce mail vous est envoyer pour tester la macros de Jlouis" 'Pour ajouter une pi?ce jointe, un fichier, classeur, image etc. '.AddAttachment 'Chemin et nom complet du fichier ? joindre .Send End With Set mMessage = Nothing 'Lib?re les ressources Set mConfig = Nothing Set mChps = Nothing End Sub
erreur d'execution 2147220973 (80040213)
Le transport à échoué dans sa connexion au serveur
Merci de votre aide






Répondre avec citation



Partager