Solved

How to turn off Microsoft Outlook security warnings

Posted on 2004-08-18
8
867 Views
Last Modified: 2008-02-01
When I send an email through my VB6 MAPI application, I get to warning messages from Outlook;

Another program is trying to access email addresses you have stored in Outlook…
Press “Yes” to allow

A program is trying to automatically send email on your behalf
Press “Yes” to allow

Is there a way to bypass \ avoid these warning messages?

Thanks in advance,
John
0
Comment
Question by:JohnFra
  • 4
  • 2
8 Comments
 
LVL 3

Expert Comment

by:ashunigam
ID: 11838109
There is a code link to bypass the message
http://www.tek-tips.com/faqs.cfm?fid=5230
0
 
LVL 3

Expert Comment

by:ashunigam
ID: 11838129
for your ease

' Declare Windows' API functions
Private Declare Function RegisterWindowMessage _
        Lib "user32" Alias "RegisterWindowMessageA" _
        (ByVal lpString As String) As Long

Private Declare Function FindWindow Lib "user32" _
        Alias "FindWindowA" (ByVal lpClassName As Any, _
        ByVal lpWindowName As Any) As Long

Private Declare Function SendMessage Lib "user32" _
        Alias "SendMessageA" (ByVal hwnd As Long, _
        ByVal wMsg As Long, ByVal wParam As Long, _
        lParam As Any) As Long

Private Sub Turn_Auto_Yes_On()
Dim wnd As Long
Dim uClickYes As Long
Dim Res As Long
uClickYes = RegisterWindowMessage("CLICKYES_SUSPEND_RESUME")
wnd = FindWindow("EXCLICKYES_WND", 0&)
Res = SendMessage(wnd, uClickYes, 1, 0)
End Sub

Private Sub Turn_Off_Auto_Yes()
Dim wnd As Long
Dim uClickYes As Long
Dim Res As Long
uClickYes = RegisterWindowMessage("CLICKYES_SUSPEND_RESUME")
wnd = FindWindow("EXCLICKYES_WND", 0&)
Res = SendMessage(wnd, uClickYes, 0, 0)
End Sub


Sub Send_Mails()
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem

'Enables automatic "YES" clicks for Outlook
Turn_Auto_YES_On               '******************

'set variables for Outlook and a message
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
    With MailOutLook
        .To = "Name of recipient"
        .Subject = "Subject Goes Here"
        .HTMLBody = "This could be a title<br><br>message body and instructions<br>could go here"
        .Attachments.Add "Path & Filename", olByValue, 1, "Filename To Display"
        .Send
    End With

'Turns off the Auto_Yes program
Turn_Off_Auto_YES                    '**********************
Set MailOutLook = Nothing
Set appOutLook = Nothing
End Sub
0
 

Author Comment

by:JohnFra
ID: 11838205
Thanks ashunigam, I tried your code but I still get the message "A program is automatically trying to send e-mail.. " And the YES is still required to continue :(
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 3

Accepted Solution

by:
ashunigam earned 250 total points
ID: 11838251
Sorry about that here is a free tool to click on your behalf that may help... from another tip from tek-ltip site.

In previous code try after removing line Turn_Off_Auto_YES                    


http://www.tek-tips.com/viewthread.cfm?qid=641859



The security dialogs that pop up when an application tries to access certain Outlook properties and methods are designed to inhibit the spread of viruses via Outlook; see http://www.slipstick.com/outlook/esecup.htm#autosec

If you are a standalone user, Outlook provides no way to suppress this behavior. However, you can use a free tool called Express ClickYes:
http://www.express-soft.com/mailmate/clickyes.html
to click the security dialog buttons automatically. Beware that this means if a virus tries to send mail using Outlook or gain access to your address book, it will
succeed.

If you're the administrator in an Exchange Server or HP OpenMail environment, you can reduce the impact of the security prompts with administrative tools. See http://www.slipstick.com/outlook/esecup/admin.htm

If it's an application you wrote yourself, normally you can use one of these approaches to redo the program:

 -- Use Extended MAPI
see http://www.slipstick.com/dev/mapi.htm and C++
or Delphi; this is the most secure method and the only one that Microsoft recommendeds.

 -- Use Redemption
http://www.dimastr.com/redemption/
a third-party COM library that wraps around Extended MAPI but parallels the Outlook Object Model

 -- Use SendKeys to "click" the buttons on the security dialogs that your application may trigger. See
http://www.slipstick.com/outlook/esecup.htm#autosec
for a link to sample code.

 -- Program the free Express ClickYes
http://www.express-soft.com/mailmate/clickyes.html
to start suspended and turn it on only when your program needs to have the buttons clicked automatically.

--
Source: Sue Mosher, Outlook MVP
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 11838554
Outlook: How do I suppress Outlook’s warning message “Someone is trying to send a mail on your behalf  …. ”
  http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/VB_Controls/Q_20706908.html
0
 
LVL 3

Expert Comment

by:ashunigam
ID: 11838784
Hi Dhaest
Just for your information.
http://www.slipstick.com/outlook/esecup.htm#autosec link is already part of my posting, that is suggested by you in link above.

Thanks
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 12378049
Answered by ashunigam
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Sharepoint 2013 error 4 54
Access query that references subform 5 47
Prevent checkbox click event occur while editing it in vb6 8 45
Spell Check in VB6 13 112
The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

773 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