Sub SendEmails()
Dim objOutlook As New Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim SendList As String
SendList = "[email protected]"
' Create new message
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
'makes the email
With objOutlookMsg
.To = SendList
.Subject = "Test Email"
.Body = "This is a test message generated on " & Now
.Attachments.Add "c:\test.txt"
.Send
End With
' Close Outlook instance: Important!
Set objOutlookMsg = Nothing
Set objOutlook = Nothing