Connecting Tech Pros Worldwide Forums | Help | Site Map

Sending email from Access

Devonish
Guest
 
Posts: n/a
#1: Nov 12 '05

I am composing an email with Access VB and then sending it from within
Access.

Everything works correctly (the email actually goes!) but Outlook ask
some
irritating questions that the user is required to answer. A summary of
the
relevant code is:

Dim mailObj as Outlook.MailItem

Set mailObj = OutlookObject.CreateItem(Outlook.olMailItem)
With mailObj
.Recipients.Add emailAddress
.Subject = "some heading"
.Body = aMessage
.Attachments.Add anInvoice
.Send
End With

The emailAddress in a string containing the email address stored in the
database but when the code reaches the .Recipients.Add statement,
Outlook
issues the message:

"A program is trying to access e-mail addresses you have stored in
Outlook.
Do you want to allow this?"

Well, I am not trying to access an address stored in Outlook. When the
use
clicks 'Yes', the same question is asked once more. Again the user must
click
'Yes'

When the code reaches the .Send statement, Outlook issues the following:

"A program is trying to automatically send e-mail on your behalf. Do
you
want to allow this?"

Outlook appears to be over cautious, assuming, or at least, suspecting a
virus.

How can I prevent these irritating messages appearing. The user simply
wants to press a button on a Form and have the appropriate email sent
automatically without having the answer 'Yes' three times.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Martin Jeffreys
Guest
 
Posts: n/a
#2: Nov 12 '05

re: Sending email from Access


This is caused by the latest security patch from Microsoft - it's intended
to stop viruses spreading. Bizarrely there's currently no way of switching
it off - that I can find anyway - although sending automatic emails from
Access is a common function.

To get around it I uninstalled Outlook - and then reinstalled it without the
patch.

Martin

"Devonish" <no.spam@nowhere.com> wrote in message
news:40928317$0$199$75868355@news.frii.net...[color=blue]
>
> I am composing an email with Access VB and then sending it from within
> Access.
>
> Everything works correctly (the email actually goes!) but Outlook ask
> some
> irritating questions that the user is required to answer. A summary of
> the
> relevant code is:
>
> Dim mailObj as Outlook.MailItem
>
> Set mailObj = OutlookObject.CreateItem(Outlook.olMailItem)
> With mailObj
> .Recipients.Add emailAddress
> .Subject = "some heading"
> .Body = aMessage
> .Attachments.Add anInvoice
> .Send
> End With
>
> The emailAddress in a string containing the email address stored in the
> database but when the code reaches the .Recipients.Add statement,
> Outlook
> issues the message:
>
> "A program is trying to access e-mail addresses you have stored in
> Outlook.
> Do you want to allow this?"
>
> Well, I am not trying to access an address stored in Outlook. When the
> use
> clicks 'Yes', the same question is asked once more. Again the user must
> click
> 'Yes'
>
> When the code reaches the .Send statement, Outlook issues the following:
>
> "A program is trying to automatically send e-mail on your behalf. Do
> you
> want to allow this?"
>
> Outlook appears to be over cautious, assuming, or at least, suspecting a
> virus.
>
> How can I prevent these irritating messages appearing. The user simply
> wants to press a button on a Form and have the appropriate email sent
> automatically without having the answer 'Yes' three times.
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it![/color]


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.550 / Virus Database: 342 - Release Date: 09/12/2003


Closed Thread