How to send email to another person with using Microsoft Visual Basic 6.0.?
Dear Friend,
Try this code, it perfectly worked for me (but the important point it will automatically send mail through outlook so please make sure that your outlook is configured before using this script)
Dim olApp As Outlook.Application
Dim olNs As Outlook.NameSpace
Dim olItem As Outlook.ContactItem
Dim olMail As Outlook.MailItem
Set olApp = CreateObject("Outlook.Application")
Set olItem = olApp.CreateItem(olContactItem)
Set olMail = olApp.CreateItem(olMailItem)
With olItem
.Email1Address = Address
End With
olMail.To = olItem.Email1Address
olMail.subject = subject
olMail.Body = Content
olMail.Send