Bonjour je suis débutant en programmation et j'aimerais avoir un script qui envoie un email a son lancement, j'ai trouver celui ci mais il affiche un message d'erreur "La valeur de configuration "SenUsing" est non (ligne : 46, caract : 2)". pouvez-vous m'aider a corriger l'erreur ? merci
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
46
47
48 Option Explicit Dim objMessage, Email, EPass Email = "*****@gmail.com" EPass = "******" Set objMessage = CreateObject("CDO.Message") objMessage.Subject = "hi" objMessage.From = Email objMessage.To = "******@gmail.com" objMessage.TextBody = "message body here" 'objMessage.AddAttachment "" objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/conf...") = 2 'Name or IP of Remote SMTP Server objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/conf...") = "smtp.gmail.com" objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/conf...") = 1 'Your UserID on the SMTP server objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/conf...") = Email 'Your password on the SMTP server objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/conf...") = EPass 'Server port (typically 25) objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/conf...") = "465" 'Use SSL for the connection (False or True) objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/conf...") = False 'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server) objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/conf...") = 60 objMessage.Configuration.Fields.Update objMessage.Send MsgBox "Message sent"
Partager