Link to home
Start Free TrialLog in
Avatar of MariaHalt
MariaHaltFlag for United States of America

asked on

Sending an email without MAPI controls, security problem with Outlook

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)

OR

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
objMail.Send

Set objMail = Nothing
Set objOutlook = Nothing

End Sub
ASKER CERTIFIED SOLUTION
Avatar of Brian Mulder
Brian Mulder
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
the email security of outlook is not to be circumvented only with the redemption controls
http://www.dimastr.com/redemption/
Avatar of MariaHalt

ASKER

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).