Sending an email without MAPI controls, security problem with Outlook

Posted on 2006-05-01
Last Modified: 2010-05-01
Running VB6 executable on several client machines.  Using an email to generate a receipt of an event for the user that emails the user.  I've been using this code a lot without any problems, until today.  

An error occurred that stated something like "Email addresses are being accessed.  Breach of security."  My assumption is that the client machine has a security feature on her MS Outlook that is causing this.  (No one else is getting this error).

My question is:  
Does anyone know what that MS Outlook feature is and how she can disable it (she probably doesn't even know it's there)


Does anyone know how to work around it from code?

Sub SendAnEmailWithoutMAPI(strRecipient As String, strSubject As String, strText As String, strAttachment As String)

'This doesn't need any MAPI controls, just reference to Microsoft Outlook Library 9.0
Dim objOutlook As New Outlook.Application
Dim objMail As MailItem

Set objMail = objOutlook.CreateItem(olMailItem)
'Where olMailItem is a built-in constant = 0 indicating the type of item to create

objMail.Recipients.Add strRecipient
objMail.Subject = strSubject
objMail.body = strText
If strAttachment <> "" Then
    'For this purpose, assume 1 file is attached
    objMail.Attachments.Add strAttachment, olByValue, Len(strText) + 1, ExtractFileNameFromPath(strAttachment)
End If

Set objMail = Nothing
Set objOutlook = Nothing

End Sub
Question by:MariaHalt
    LVL 44

    Accepted Solution

    Hi MariaHalt,

    you can use this alternative

    hope this helps a bit
    LVL 44

    Expert Comment

    the email security of outlook is not to be circumvented only with the redemption controls

    Author Comment

    Also, it turned out that the user never checked off the "save password" in her Outlook, so she was typing it in everytime she accessed her email...I suggested she check it off and lock her computer whenever she leaves her desk (like she should be doing anyway).

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
    Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now