|
-
August 28th, 2001, 11:25 PM
#1
how to generate emails using outlook express
i want to genearte emails using outlook express object plz send me the codes and the libraries which i need to have along with the screen design as iam new to vb
-
August 29th, 2001, 07:08 AM
#2
Re: how to generate emails using outlook express
add the Outlook Type library to the references of your project
Dim MyApp as Outlook.Application
Dim MyMailItem as Outlook.MailItem
set MyApp = new Outlook.Application
set MyMailItem = MyApp.CreateObject(olMailItem)
MyMailItem.Recipients.Add ("[email protected]") ' replace with a real address
'it can be '.To = "[email protected]"
MyMailItem.Subject = "Test" ' Subject field of the email
MyMailItem.Body = "This is just a Test!!!" ' main body of the email
'or for HTML report
'.HTMLBody = GetReport 'gets the report and puts into HTML
MyMailItem.CC = "[email protected]" ' replace with a real address
'.Importance = olImportanceNormal
MyMailItem.Send () ' send the message
'Close Outlook
Set MyApp = Nothing
Set MyMailItem = Nothing
'To send to recipients in thyour Address book
Recipients.Add "Joe Smith"), if "Joe Smith" is in your address book, & Outlook will find the right email address
for you.
Iouri Boutchkine
[email protected]
-
September 27th, 2001, 12:45 PM
#3
Re: how to generate emails using outlook express
I tried your code for Outlook 2000 and it failed at the line:
set MyMailItem = MyApp.CreateObject(olMailItem)
it works with the following line tho:
set MyMailItem = MyApp.CreateItem(olMailItem)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|