Bonjour le Forum
Je suis bloquer sur une macro d'envoi d'email via CDO sous excel.
Mais je me retrouve avec une erreur 2147220973 (80040213)
au niveau du "send" de la macro, je pense que cela provient du fait que l'on doit à chaque nouvelle page internet lui indiquer son logging et mot de passe via LDAP (car la macro fonctionne lorsque je suis hors reseau)
Comment est il possible de rajouter le logging à l'accés internet dans la macro suivante :
Merci pour votre aide
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
42
43
44
45 Sub CDO_Mail_Small_Text_2() Dim iMsg As Object Dim iConf As Object Dim strbody As String Dim Flds As Variant Set iMsg = CreateObject("CDO.Message") Set iConf = CreateObject("CDO.Configuration") iConf.Load -1 ' CDO Source Defaults Set Flds = iConf.Fields With Flds .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "sxxx@xxxx.fr" .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "xxxx" .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com" .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465 .Update End With strbody = "Hi there" & vbNewLine & vbNewLine & _ "This is line 1" & vbNewLine & _ "This is line 2" & vbNewLine & _ "This is line 3" & vbNewLine & _ "This is line 4" With iMsg Set .Configuration = iConf .To = "xxxr@xxxx.fr" .CC = "" .BCC = "" ' Note: The reply address is not working if you use this Gmail example ' It will use your Gmail address automatic. But you can add this line ' to change the reply address .ReplyTo = "Reply@something.nl" .From = """sxxx"" <sxxxxxxx>" .Subject = "Important message" .TextBody = strbody '.AddAttachment "D:/xxb.zip" 'Pour mettre un fichier .Send End With End Sub
Partager