Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I wrote the following code for send a mail...
VB
Dim OL As Outlook.Application
           Dim olMail As Outlook.MailItem
           Dim myattachments As Outlook.Attachments
           Set OL = CreateObject("Outlook.Application")
           Set olMail = OL.CreateItem(olMailItem)
           Set myattachments = olMail.Attachments
       olMail.To = "mymaild"
       olMail.CC = "mymaild"
       olMail.Body = "TEST MAIL NOW"
       olMail.Subject = "TEST MAIL NOW"
       olMail.Send
       Set olMail = Nothing
           Set OL = Nothing



Its working only my outlook mail is opened...otherwise the mail didn't send..i want to send a mail the outlook was closed.Thanks in advance...

by Subbu
Posted

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900