Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2038
  • Last Modified:

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
Srinib
0
srinib
Asked:
srinib
  • 6
  • 5
1 Solution
 
sajuksCommented:
Check http://www.slipstick.com/outlook/esecup.htm#autosec
The best option would be to use Outlook Redemption from http://www.dimastr.com/redemption/
Since you are not interested in Express ClickYes
0
 
sajuksCommented:
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.Recipients.Add(abc@xyz.com')
oleSafeMailItem.Recipients.ResolveAll
oleSafeMailItem.Subject = Using Redemption mail'
oleSafeMailItem.Send

if isValid(oleSafeMailItem) then destroy oleSafeMailItem

if isValid(oleNameSpace) then
 oleNameSpace.logoff()
 destroy oleNameSpace
end if

if isValid(oleOutlook) then
 oleOutlook.DisconnectObject()
 destroy oleOutlook
end if
0
 
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
Srinib
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
sajuksCommented:
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 ?
0
 
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.

///////////////////////////////////////////////////////////////////////////
Loop1:
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
      g_session.mailAddress(i_mailmessage)
      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
                  else
                        mle_to.text = mle_to.text + "; " + ls_recipient
                  end if
            next
      else
            return
      end if

else
      lw_parent.WindowState = Minimized!
      reconnectsqlca()
      GOTO Loop1
end if

Thanks again
Srinib
0
 
sajuksCommented:
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 .
0
 
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.

Thanks
Srinib
0
 
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
http://www.dimastr.com/Redemption/

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
Srinib
0
 
sajuksCommented:
The redemption dll is not free for commercial use you will've to buy it .Check the site there are lot of examples around.
0
 
srinibAuthor Commented:
OK..fine.

Can you please help me on other part.

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

Thanks
Srinib
0
 
sajuksCommented:
Check  http://www.experts-exchange.com/Programming/Programming_Languages/PowerBuilder/Q_21223603.html      
the code that ur looking for
oleNameSpace.Logon("outlook", "G3tMyM@il01$", true, true)
0
 
gcartaCommented:
Hi,


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.

Thanks

Greg
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now