MariaHalt
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(str Recipient 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(olMa ilItem)
'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(st rAttachmen t)
End If
objMail.Send
Set objMail = Nothing
Set objOutlook = Nothing
End Sub
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(str
'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(olMa
'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(st
End If
objMail.Send
Set objMail = Nothing
Set objOutlook = Nothing
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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).
http://www.dimastr.com/redemption/