Can someone help me about this i would like to make send email using my Outlook that is on my pc to get my criteria as: user name, my email and so one.
Let's say I’m at work and I have my own account in the company and I’m already logged in Outlook.
I want from my application when i fill out:
Name: send to email user (textbox)
CC: someone else to add in copy (textbox)
Subject: something as subject (textbox)
Attachment: Attach files to email
Button send email.
What i need is how to make the attachments i have 1 button Browse, where i can select 1 or more items at same time.
Public Sub SendMail()
Dim oEmail As MailItem = CType(New Application().CreateItem(OlItemType.olMailItem), MailItem)
oEmail.Recipients.Add("bgates@microsoft.com")
oEmail.CC = "meow@example.com"
oEmail.Recipients.ResolveAll()
oEmail.Subject = "Spam - Meow!"
oEmail.BodyFormat = OlBodyFormat.olFormatHTML
oEmail.Body = "Blah, blah, blah..."
oEmail.Importance = OlImportance.olImportanceHigh
oEmail.ReadReceiptRequested = True
oEmail.Attachments.Add("C:\Cat.bmp", OlAttachmentType.olByValue)
oEmail.Recipients.ResolveAll()
oEmail.Save()
oEmail.Display(False) 'Show the email message and allow for editing before sending
oEmail.Send() 'You can automatically send the email without displaying it.
End Sub