Sub test()
Dim tmp
Dim strTo As String
Dim i As Integer, n As Integer
Dim fso, f
Set WshShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set f = objFSO.OpenTextFile(Maillist, ForReading)
n = 0
Do While f.AtEndOfStream <> True
'the second argument of the splitfunction is the separator (here it's a tab)
' tableau temporaire des adresses de la ligne en cours
tmp = Split(f.ReadLine, Chr(59))
'wscript.echo arrtemp(0) & " " & arrtemp(1)
For i = 0 To UBound(tmp)
strTo = strTo & tmp(i) & ";"
Next
Loop
'enlever le dernier ';'
strTo = Left(strTo, Len(strTo) - 1)
'Envoyer le à toutes les adresses de la chaine StrTo
SendMail (strTo)
End Sub
Function SendMail(strSMTP)
Dim i As Integer, cpt As Integer
Dim TxtMessage As String, sTo As String
Dim strEmail
Dim strMsg
Dim oLook
Dim oMail
TxtMessage = ReadBody(BodyFile)
cpt = UBound(strSMTP)
Set WshShell = CreateObject("WScript.Shell")
Set oLook = CreateObject("Outlook.Application")
Set oMail = oLook.createitem(0)
With oMail
.To = strSMTP
.body = TxtMessage
.Subject = "Compte-rendu de la dernière réunion"
'.Attachments.Add (strAttachments)
.Display
'wscript.sleep (Now + TimeValue("0:00:02"))
End With
' envoi des message
WshShell.SendKeys "%y"
Set oMail = Nothing
Set oLook = Nothing
End If
End Function