how to generate email

lakkadghat

Newcomer
Joined
Jul 26, 2003
Messages
12
Hello
i want to generate an email taking the email address from the database and directly send it to outlook's outbox.
i am a new bee.
any clues how to do it.?????

regards

lakkadghat
 
Hey there. Personally I think the easiest way is get the email address from the db as a string. Add a reference to the Microsoft Outlook Object Library (the version will depend on what version of Outlook you run).

This works for me - I'm running Outlook 2002 (sp2)

Dim x As Outlook.MailItem
Dim ol As New Outlook.Application


x = ol.CreateItem(Outlook.OlItemType.olMailItem)

x.To = "mydknight25@hotmail.com" 'Insert your email address here
x.Subject = "hello"
x.Body = "waahahaha"
x.Send()

tadaaaa
Don't forget to clean up afterwards.
 
Back
Top