Bonjour à tous,

Je rencontre un probleme avec l'utilisation mailcdo.

je suis en serveur 2003 et lorsque je lance mon script j'ai un message d'erreur

La valeur de configuration "Sendusing" est non valide;
je vérifie la date de creation de mes fichiers et je les compare à ma date système puis je déclenche un envoi mail

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
Sub SendMailCDO(aTo, Subject, TextBody, aFrom) 
  Const cdoOutlookExvbsss = 2 
  Const cdoIIS = 1 
 
  Dim Message ' As New CDO.Message 
 
  'Create CDO message object 
  Set Message = CreateObject("CDO.Message" ) 
  With Message 
    'Load IIS configuration 
    .Configuration.Load cdoIIS 
 
    'Set email adress, subject And body 
    .To = "jobar38@nono.fr" 
    .Subject = "Probleme remonté base" 
    .TextBody = "TextBody"
 
    'Set sender address If specified. 
    If Len(aFrom) > 0 Then 
       .From = "test@nono.fr" 
    End If 
 
    'Send the message 
    .Send 
  End With 
End Sub 
 
' Call clean function 
CleanFolder sPath 
 
' do a report 
sReport = "Rapport de nettoyage du " & now() & vbCrLf 
sreport = sReport & "---------------------------------------" & vbCrLf 
sReport = sReport & "Nombre de fichiers impactés : " & sReportFilesCount & vbCrlf 
sReport = sReport & "Nombre de dossiers impactés : " & sReportFoldersCount & vbCrLf 
sReport = sReport & "---------------------------------------" & vbCrLf 
sReport = sReport & sReportFiles 
sReport = sReport & "---------------------------------------" & vbCrLf 
sReport = sReport & sReportFolders 
sReport = sReport & "---------------------------------------" & vbCrLf 
 
' send report by email 
SendMailCDO "test@domaine.fr", "dossiers impactés", sReport, "test@domaine.fr"
une ame charitable peut-elle m'aider