send email via outlook
When attempting to send a email from my application via outlook with the following code. I am always prompted to supply a username and password for the account, even thought the dialog box has them in and i have checked save password. is there any way off coding this not to happen ?
Imports
Microsoft.VisualBasicImports
System.net.MailImports
Microsoft.Office.InteropPublic
SharedSub EmailwithOutlook()Dim oOAppAs Outlook.ApplicationDim oOMailAs Outlook.MailItemoOApp = CreateObject(
"Outlook.Application")oOMail = oOApp.CreateItem(Outlook.OlItemType.olMailItem)
With oOMail.To =
"username@hotmail.com".Subject =
"email subject " &Date.Now.Body =
"email message"'.Attachments.Add("\\server\drive\folder\filename", olByValue, 1).Send()
EndWithEndSub
