jerry12302
Active Member
- Joined
- Apr 18, 2005
- Messages
- 449
- Office Version
- 2010
- Platform
- Windows
Can someone look at this code and tell me if it is appropriate? Is there a better way to do it?
I have been having problems with emails getting through when I use this.
Sub MailerTest()
Dim objol As New Outlook.Application
Dim objmail As MailItem
Set objol = New Outlook.Application
Set objmail = objol.createitem(olmailitem)
With objmail
.To = "someemailaddress@yahoo.com"
.cc = "ccsomeemailaddress@hotmail.com"
.Subject = "Test 12/9 10:39"
.Body = "This is a Test 12/9 10:39"
.NoAging = True
.Attachments.Add "C:\somefile.xls"
.display
End With
Set objmail = Nothing
Set objol = Nothing
SendKeys "%{s}", True
End Sub
Thanks for your help!
I have been having problems with emails getting through when I use this.
Sub MailerTest()
Dim objol As New Outlook.Application
Dim objmail As MailItem
Set objol = New Outlook.Application
Set objmail = objol.createitem(olmailitem)
With objmail
.To = "someemailaddress@yahoo.com"
.cc = "ccsomeemailaddress@hotmail.com"
.Subject = "Test 12/9 10:39"
.Body = "This is a Test 12/9 10:39"
.NoAging = True
.Attachments.Add "C:\somefile.xls"
.display
End With
Set objmail = Nothing
Set objol = Nothing
SendKeys "%{s}", True
End Sub
Thanks for your help!