Link to home
Start Free TrialLog in
Avatar of srinib
srinib

asked on

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
Avatar of sajuks
sajuks

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
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
Avatar of srinib

ASKER

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
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 ?
Avatar of srinib

ASKER

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
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 .
Avatar of srinib

ASKER

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
Avatar of srinib

ASKER

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
The redemption dll is not free for commercial use you will've to buy it .Check the site there are lot of examples around.
Avatar of srinib

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of sajuks
sajuks

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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