Results 1 to 3 of 3
  1. #1
    jj1 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    128

    How to avoid security warning when an automatic email is sent from the access?


    I have a "recognition database". Every time one person recognize another person. The person chooses other person's name in the drop down and when that record is saved an email should be sent to the person to let him know that recognition for him has been submitted in the database. I am using the code below it works fine and it send email but gives me a security warnings every time an automatic email is sent. It will be pain if everyone has to select "Allow" everytime. So I do not want to have that popup. Please check my code and suggest how I can avoid that security popup.
    Code:
    Private Sub Label140_Click()On Error Resume Next
    Dim Combo97  As String
    Dim stText96 As String
    
    
    
    
    If IsNull(Me![Combo97]) Then
        MsgBox "You must read the Recognition.", vbOKOnly, "More Data Required!"
        Exit Sub
    End If
    
    
    RunCommand acCmdSaveRecord
    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
    Me.Refresh
    Me.Dirty = False
    Dim oApp As Outlook.Application
    Dim oMail As MailItem
    Set oApp = CreateObject("Outlook.application")
    
    
    Set oMail = oApp.CreateItem(olMailItem)
    
    
     stText96 = Format(Me.Text96, "00000")
     
    oMail.HTMLBody = "A Recognition has been submitted for you in the Recognition database. Please address this Recognition.." & Chr$(13) & _
                   Chr$(13) & "Recognition Number: " & stText96 & Chr$(13) & "" & Chr$(13) & _
                   Chr$(13) & "Below is the link to the database... " & Chr$(13) & _
                   Chr$(13) & "<a href=""" & "C:\Recognition - Front End.mde" & """>" & "C:\Recognition- Front End.mde" & "</a > " & Chr$(13) & _
                   Chr$(13) & "***THIS IS A SYSTEM GENERATED EMAIL. PLEASE DO NOT REPLY TO THIS EMAIL****."
     
    oMail.Subject = "You have received a new Recognition."
    oMail.To = Forms![New Recognition]!Combo97
    oMail.CC = ""
    oMail.Send
    Set oMail = Nothing
    Set oApp = Nothing
    
    
    DoCmd.GoToRecord , , acNewRec
    'DoCmd.Close acForm, NewRecognition, acSaveYes
    'Exit_addNewRecord_Click:
    '    Exit Sub
    'Err_addNewRecord_Click:
    '    MsgBox Err.Description
    '    Resume Exit_addNewRecord_Click
    
    
    End Sub
    The popup I receive is as follows.

    Click image for larger version. 

Name:	Capture.PNG 
Views:	16 
Size:	14.1 KB 
ID:	24616

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 10 Access 2013
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,538
    at the beginning of your code add this line


    Code:
    DoCmd.SetWarnings False
    At the end reset the warnings

    Code:
    DoCmd.SetWarnings True

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    There are three options that I know of unless you are using Exchange Server.
    ClickYes: http://www.contextmagic.com/express-clickyes/
    Redemption: http://www.dimastr.com/redemption/home.htm
    CDO: https://www.microsoft.com/en-us/down...s.aspx?id=3671

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 8
    Last Post: 01-20-2015, 01:08 AM
  2. Enable Security Warning
    By handsomealso in forum Security
    Replies: 3
    Last Post: 09-14-2014, 12:41 AM
  3. MS Access triggering Outlook Security warning
    By Amiga1200 in forum Programming
    Replies: 5
    Last Post: 05-22-2014, 11:24 PM
  4. security warning
    By wthoffman in forum Access
    Replies: 3
    Last Post: 02-26-2011, 09:22 AM
  5. Security Warning
    By mojo53777 in forum Security
    Replies: 0
    Last Post: 11-16-2007, 06:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums