Wrox Programmer Forums
|
Visual Basic 2008 Essentials If you are new to Visual Basic programming with version 2008, this is the place to start your questions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2008 Essentials section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 20th, 2010, 07:02 AM
Authorized User
 
Join Date: Dec 2009
Posts: 69
Thanks: 6
Thanked 0 Times in 0 Posts
Default Outlook email

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.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook email through Access desireemm Access 1 August 26th, 2005 11:31 AM
Access email blocked by Outlook access Access 3 June 16th, 2005 07:23 AM
Outlook Email Fomatting roguedog Access 1 February 1st, 2005 05:02 PM
Sending an email without Outlook SaharaWizard Pro VB 6 3 August 12th, 2004 04:15 PM
Email using Outlook Ben Access VBA 3 January 30th, 2004 05:39 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.