We help IT Professionals succeed at work.
Get Started

sending email to outlook from vb6 program - warning messages in outlook

morrisbo asked
Last Modified: 2013-11-25
I am developing a vb6 application that uses outlook to send an email from within the vb6 program.  The message is sent but only after outlook displays 2 warning messages about "A program is trying to access e-mail addresses you have stored in outlook" and "A program is trying to automatically send email on your behalf".

I do not want the error messages to pop up.  See the attached file for screen snapshot of the warning messages.  Also, I have checked the Microsoft Outlook 11.0 Object Library.

Thanks for any help on how I can eliminate the messages.

Private Sub mnuEmailTest_Click()
Dim oApp As Object 'Outlook
Dim oNewMail As Object

Set oApp = New Outlook.Application
Set oNewMail = oApp.CreateItem(olMailItem)
With oNewMail
   .Recipients.Add "mb@testwebsite.com"
   .Subject = "Subject here"
   .Body = "Text here"
   .Attachments.Add "c:\mypdf.pdf"
End With
Set oNewMail = Nothing
Set oApp = Nothing
End Sub

Open in new window

Watch Question
Top Expert 2010
This problem has been solved!
Unlock 2 Answers and 4 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE