Send email via VBA code

W

wei

Hi everybody,

I have an Access VBA application, at the end of which
will send emails to our customers. The annoying part is
that each time a message box will pop up, saying that "A
program is trying to send email on your behalf. Do you
want to allow this?" And I have to click "Yes" button to
continue.

I didn't have this problem when I used Window 2000. I've
just switched to Windows XP Professional. I guess there
must be option to disable the message. But where and how?
Any help will be greatly appreciated. Hopefully soon I
don't need to click Yes a hundred time or so every day.

Thanks again in advance.

Wei
 
C

Cheryl Fischer

If you simply want something to automate the clicking of the 'Yes' key,
there is a very nice, FREE utility available from:
http://www.express-soft.com/mailmate/clickyes.html that will take care of
that problem for you. It will require just a couple lines of additional
code (samples provided at website). I have used it in client applications
and have found that it works very well.

hth,
 
K

Kiran Adimatyam

Also, you can write your own code to kill this security dialog by
using hooks. But, this is a bit time consuming task and requires lot
of low level programming. I am telling this just in case you don't
want to rely on a third party product or simply you don't want to
spend money.

This is the way to do it:
Create a hook which will notify your VBA app that the security box is
created. Once you get the notification, send messages to the window
which will dismiss it. If you have a progress bar in the window, you
need to subclass that too to push its max. value within 5 seconds.
Outlook by default waits for 5 seconds within which time, it updates
the progressbar and at the end of 5 seconds, it will enable the 'Yes'
butoon when your VBA app. tries to send emails. You can also create
an add-in which will be hooking into Outlook which does the same
thing.

Btw, there is a paper on the web by US Airforce engineers which might
help you in bypassing these security issues using simple Windows
Script Host. You can find it at this location,
http://www.usafa.af.mil/dfcs/papers/mcc/ieeesmc2001.pdf. Good luck.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top