Full Version: Sending an Email - Outlook Security Popup
UtterAccess Discussion Forums > Microsoft® Access > Access Automation
jsheridan441
I am having a problem when trying to automate an email. The outlook security msg pops up and if I click yes everything is ok.

However, if I click "NO" then I get runtime error 287. Any assistance would be appreciated. Below is a copy of my code.


Private Sub Text102_AfterUpdate()
Dim mess_body As String
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
Dim strReqEmail As String
strReqEmail = (DLookup("[chrEmailAddress]", "tblRequestors", "[chrRequestorName] = [Forms]![frmSCMRTRequest]![Requestor Name]"))

Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
.BodyFormat = olFormatRichText
.To = strReqEmail
.Subject = "Request " & [Forms]![frmSCMRTRequest]!RQST_NBR & " has been assigned " & Me.Text102
.HTMLBody = "Your request has been assigned " & Me.Text102 & " and is continuing through the process" & _
" and you will be notified if there is any delay."
'.DeleteAfterSubmit = True 'This would let Outlook send the note without storing
.Send
End With
'MsgBox MailOutLook.Body
End Sub
jsheridan441
Thank you!
jwhite
You're Welcome! thumbup.gif Good luck with your project!
cew657
Frank Kegley (a member here at UA) provided the below link to a website as another option to getting around Outlook security.

Outlook Security Bypass

I thought I would throw it out as another option.

Chad
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.