Auto Click YES when Outlooks Security Guard opens prompt dialog

Hi All,

"A program is trying to access e-mail addresses you have stored in Outlook. Do you want to allow this?"
I am getting this annoying message when try to send an email.
Is there anyway to get rid of this annoying outllook message?

Note : I do not want to use any freewares for this.

Thanks in advance
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The best option would be to use Outlook Redemption from
Since you are not interested in Express ClickYes
Heres a simple example on how to use the redemption dll

integer rc
oleobject oleSafeMailItem
oleobject oleTmp
oleobject oleOutlook
oleobject oleNameSpace

oleOutlook = create oleobject
rc = oleOutlook.ConnectToNewObject('Outlook.Application')

oleNameSpace = oleOutlook.GetNameSpace('MAPI')
oleNameSpace.Logon('', '', true, true)

oleSafeMailItem = create oleobject
rc = oleSafeMailItem.ConnectToNewObject('Redemption.SafeMailItem')

oleTmp = create oleobject
oleTmp = oleOutlook.CreateItem(0)
oleSafeMailItem.Item = oleTmp
oleSafeMailItem.Subject = Using Redemption mail'

if isValid(oleSafeMailItem) then destroy oleSafeMailItem

if isValid(oleNameSpace) then
 destroy oleNameSpace
end if

if isValid(oleOutlook) then
 destroy oleOutlook
end if
srinibAuthor Commented:
I am getting this popup at this below line.
ls_username = upper(iolenamespace.currentUser.Name)

Let me know what code i should write before or after that line (using redemption dll).

Thanks for your time
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Srinib the code tha you've pasted is obviously yours and not mine . How cam i offer a opinion based on just one line of code .
First tell me did you try the code that i'd pasted ? Did it prompt you to click Yes ?
srinibAuthor Commented:
here is my code in the command button. You may not find the variable declaration as it is not pasted.
I did not worked on your code since i need to make the changes in the following code as i am doing maintenance work for this.

lw_parent.WindowState = Normal!
 if checkconnection() then
      if not isvalid(g_session) then
            g_session = CREATE mailSession
            ls_username = upper(iolenamespace.currentUser.Name)//Popup appears
            mRet = g_session.mailLogon(ls_username,"")
            if mRet <> mailReturnSuccess! then
                  MessageBox("Error","Unable to establish contact with email client.  Please contact System Administrator")
            end if
      end if
      if UpperBound(i_mailmessage.Recipient) > 0 then
            mle_to.text = ""
            for ll_loop = 1 to UpperBound(i_mailmessage.recipient)
                  ls_recipient = i_mailmessage.recipient[ll_loop].name
                  if ll_loop = 1 then
                        mle_to.text = ls_recipient
                        mle_to.text = mle_to.text + "; " + ls_recipient
                  end if
      end if

      lw_parent.WindowState = Minimized!
      GOTO Loop1
end if

Thanks again
if you want to use Redemption dll the you need to follow certain steps of codes like the example i posted. The other alternative is to use extended mapi to prevent the security warning from being popped up.Unfortunatley PB doesnt support extended Mapi. Third option that you've is use jmail or funcky mail dlls.
Your above code uses normal MAPI so the security popup will appear. Check out with the people whom you are doing maintenace worj what option they would prefer .
srinibAuthor Commented:
Thanks for you suggestion. I will ask my people on this and let you know if i need further help in couple of days.

srinibAuthor Commented:
Sorry for the delay.

I have one question.

Is that Redemption.dll can be distrubuted along with application?
Or do we need to get the distributed version from the corresponding vendor?

I am getting the following message when regestering a dll.

1. This software product is licensed to you for the software development
purposes only.
This product may not be distributed or copied except for backup purposes.

2. If you need a distributable version, please visit

Please let me know the details.

And also, i need your help on extending your sample code.
I need to get the mail ids from the address book instead hardcoding. Please help me on this.

Thanks again and again
The redemption dll is not free for commercial use you will've to buy it .Check the site there are lot of examples around.
srinibAuthor Commented:

Can you please help me on other part.

I need to get the mail ids from the address book using your code instead hardcoding .

the code that ur looking for
oleNameSpace.Logon("outlook", "G3tMyM@il01$", true, true)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial

I have tried the above code posted by sajuks, and it works.  I was wondering how to get text into the body of the email.  there dose not seem to be any oleSafeMailItem.BODY variable.


It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.