Function SendMsg(strSubject As String, _
strBody As String, _
strTO As String, _
Optional strDoc As String, _
Optional strCC As String, _
Optional strBCC As String)
Dim oLapp As Outlook.Application
Dim oItem As Outlook.MailItem
Set oLapp = CreateObject("Outlook.Application")
Set oItem = oLapp.CreateItem(olMailItem)
oItem.Subject = strSubject
oItem.To = strTO
oItem.CC = strCC
oItem.BCC = strBCC
oItem.BodyFormat = olFormatHTML
oItem.HTMLBody = strBody
oItem.Importance = olImportanceHigh
'oItem.Display - Displays the email but doesn't send so you can see what it looks like
oItem.send
Set oLapp = Nothing
Set oItem = Nothing
End Function
|