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
| Function MailBlat()
Dim Recipient, cc, mailhost, sender, subject, strCommand,AttDoc,AttDocZ
Set objShell = CreateObject("Wscript.Shell")
Listsmtp=array("smtp.FAI1.com","smtp.FAI2.com","smtp.FAI3.com","smtp.FAI4.com","smtp.FAI5.com")
For X=LBound(Listsmtp) to UBound(Listsmtp)
ComputerName = objShell.ExpandEnvironmentStrings("%COMPUTERNAME%")
Recipient = "mon-e-mail@doMailBlate.fr"
cc = "autre-e-mail@doMailBlate.com"
mailhost = Listsmtp(X)
sender = ComputerName&"@"&ComputerName&".com"
subject = "Resultat de mailblat " & Date()
AttDoc = "c:\TestVBscript\iplog.htm"
AttDocZ = "C:\Crypt&Decrypt\MailBlat\mailblat.rar"
strCommand = "%comspec% /c blat.exe -to " & Chr(34) & recipient & Chr(34) & ""
strCommand = strCommand & " -log ""Blat.log"""
strCommand = strCommand & " -cc " & Chr(34) & cc & Chr(34) & ""
strCommand = strCommand & " -server " & Chr(34) & mailhost & Chr(34) & ""
strCommand = strCommand & " -subject " & Chr(34) & subject & Chr(34) & ""
strCommand = strCommand & " -body " & Chr(34) & "Ceci est le Corps du message" & Chr(34) & ""
strCommand = strCommand & " -bodyF " & chr(34) & AttDoc & chr(34) & ""
strCommand = strCommand & " -attach " & Chr(34) & AttDocZ & Chr(34) & ""
strCommand = strCommand & " -f " & Chr(34) & sender & Chr(34) & ""
strCommand = strCommand & " -q"
Result = objShell.Run(strCommand,0,True)
Next
MsgBox "Message Envoyé !",64,"MailBlat"
End Function
MailBlat |
Partager