In word you can send mail to other users, How do I use
this email capability in VB? Please shed some light.
Thanks,
Printable View
In word you can send mail to other users, How do I use
this email capability in VB? Please shed some light.
Thanks,
You can use Outlook Object Library. So, first, add a reference to Microsoft Outlook 98 Type Library (or select the version yo have installed). Then use this code:
Code:Private Sub Command1_Click()
Dim objOutlook As New Outlook.Application
Dim objMailItem As New Outlook.MailItem
Set objMailItem = objOutlook.CreateItem(olMailItem)
With objMailItem
.To = "[email protected]"
.Subject = "This is a test email"
.Body = "It is amazing what you can do with Outlook object library."
.Send
End With
End Sub