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.Applica tion
Dim olNs As Outlook.NameSpa ce
Dim olItem As Outlook.Contact Item
Dim olMail As Outlook.MailIte m
Set olApp = CreateObject("O utlook.Applicat ion")
Set olItem = olApp.CreateIte m(olContactItem )
Set olMail = olApp.CreateIte m(olMailItem)
With olItem
.Email1Address = Address
End With
olMail.To = olItem.Email1Ad dress
olMail.subject = subject
olMail.Body = Content
olMail.Send