I have an application where I wish to send an email to the user (several) and am using the following code. Unfortunately, I keep getting an error on the last line in bold.
<Imports System.Net.Mail>
<Imports System.Web.Mail>
<Dim olApp As Outlook.Application>
<Dim MailMsg As Outlook.MailItem>
<olApp = New Outlook.ApplicationClass>
<olApp = CreateObject("outlook.application")>
<MailMsg = olApp.CreateItem(Outlook.OlItemType.olMailItem)>
<MailMsg.To = "
[email protected]">
<MailMsg.Subject = "Project No">
<MailMsg.Body = "A new Project has been created. Its number is:" & vbCrLf & sJobNo2>
<MailMsg.HTMLBody = True>
<
MailMsg.Send()>
The error is:
"Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT))"
I would appreciate your help.