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
| Sub EnvoiMail()
Dim OutlookApp As Object
Dim Mail As Object
Set OutlookApp = CreateObject("Outlook.Application")
Set Mail = OutlookApp.CreateItem(0)
With Mail
.To = "mon destinataire"
.CC = "mes copies"
.Subject = "Sujet"
.BodyFormat = olFormatHTML
.HTMLBody = "Bonjour,<br><br>" & GetBoiler("C:\Documents and Settings\ma_signature.htm")
.Send
End With
Set Mail = Nothing
Set OutlookApp = Nothing
End Sub
Function GetBoiler(ByVal sFile As String) As String
Dim fso As Object
Dim ts As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.GetFile(sFile).OpenAsTextStream(1, -2)
GetBoiler = ts.readall
ts.Close
End Function |
Partager