By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,057 Members | 1,249 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,057 IT Pros & Developers. It's quick & easy.

Outlook "Security" causing a headache

P: n/a
Hi folks,

I have an a2k ap which is called from a batch file via task scheduler
on at night - it runs a bunch of updates, imports stuff from other
databases and generally preps the main backend for another day's work.
It logs everything and generates an email which it sends to a few
people, issuing warnings if there were problems. Have you guessed the
problem yet?

Outlook 2003 / SP2 - "...Trying to send a mail...", "...use address
book..." messages. Usually I'd install outlook redemption, or a
different email client or something but since it's a banking
environment there are strict rules about software:

Can't reduce security in exchange
Can't install 3rd party patches to licenced software
etc, etc...

I need a solution!!!
- is there a way to bypass the email client and directly send an email
from the exchange server without bringing a tonne of warining messages
down on my head?
- failing that, are there any other solutions other people here have
used?

Apr 20 '06 #1
Share this Question
Share on Google+
14 Replies


P: n/a
BillCo wrote:
Hi folks,

I have an a2k ap which is called from a batch file via task scheduler
on at night - it runs a bunch of updates, imports stuff from other
databases and generally preps the main backend for another day's work.
It logs everything and generates an email which it sends to a few
people, issuing warnings if there were problems. Have you guessed the
problem yet?

Outlook 2003 / SP2 - "...Trying to send a mail...", "...use address
book..." messages. Usually I'd install outlook redemption, or a
different email client or something but since it's a banking
environment there are strict rules about software:

Can't reduce security in exchange
Can't install 3rd party patches to licenced software
etc, etc...

I need a solution!!!
- is there a way to bypass the email client and directly send an email
from the exchange server without bringing a tonne of warining messages
down on my head?
- failing that, are there any other solutions other people here have
used?


If the OS is Windows 2K or XP then it already has CDOSys messaging library
installed and you can automate that instead of Outlook. If you Google on "CDO"
you should easily find code examples.
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Apr 20 '06 #2

P: n/a
I once tried CDO and noticed that one needs an open InternetConnection to use it.
So you would need to check for a connection first or only use CDO with a broadband (always open) connection.
Right/wrong?

Arno R

"Rick Brandt" <ri*********@hotmail.com> schreef in bericht news:t8*****************@newssvr12.news.prodigy.co m...
BillCo wrote:
Hi folks,

I have an a2k ap which is called from a batch file via task scheduler
on at night - it runs a bunch of updates, imports stuff from other
databases and generally preps the main backend for another day's work.
It logs everything and generates an email which it sends to a few
people, issuing warnings if there were problems. Have you guessed the
problem yet?

Outlook 2003 / SP2 - "...Trying to send a mail...", "...use address
book..." messages. Usually I'd install outlook redemption, or a
different email client or something but since it's a banking
environment there are strict rules about software:

Can't reduce security in exchange
Can't install 3rd party patches to licenced software
etc, etc...

I need a solution!!!
- is there a way to bypass the email client and directly send an email
from the exchange server without bringing a tonne of warining messages
down on my head?
- failing that, are there any other solutions other people here have
used?


If the OS is Windows 2K or XP then it already has CDOSys messaging library
installed and you can automate that instead of Outlook. If you Google on "CDO"
you should easily find code examples.


--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com

Apr 20 '06 #3

P: n/a
Sorry Rick and others.
I used the wrong account here...

Arno R

"StopThisAdvertising" <StopThisAdvertising@DataShit> schreef in bericht news:44**********************@text.nova.planet.nl. ..
I once tried CDO and noticed that one needs an open InternetConnection to use it.
So you would need to check for a connection first or only use CDO with a broadband (always open) connection.
Right/wrong?

Arno R

"Rick Brandt" <ri*********@hotmail.com> schreef in bericht news:t8*****************@newssvr12.news.prodigy.co m...
BillCo wrote:
Hi folks,

I have an a2k ap which is called from a batch file via task scheduler
on at night - it runs a bunch of updates, imports stuff from other
databases and generally preps the main backend for another day's work.
It logs everything and generates an email which it sends to a few
people, issuing warnings if there were problems. Have you guessed the
problem yet?

Outlook 2003 / SP2 - "...Trying to send a mail...", "...use address
book..." messages. Usually I'd install outlook redemption, or a
different email client or something but since it's a banking
environment there are strict rules about software:

Can't reduce security in exchange
Can't install 3rd party patches to licenced software
etc, etc...

I need a solution!!!
- is there a way to bypass the email client and directly send an email
from the exchange server without bringing a tonne of warining messages
down on my head?
- failing that, are there any other solutions other people here have
used?


If the OS is Windows 2K or XP then it already has CDOSys messaging library
installed and you can automate that instead of Outlook. If you Google on "CDO"
you should easily find code examples.


--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com

Apr 20 '06 #4

P: n/a
I've been working on a solution to this same problem and would
appreciate input/guidance (aside from handslaps I know I'll get for
using SendKeys).

Here's the code I've come up with. It works - bypassing the Outlook
Security messages - when run in real-time from the debug window. But
when scheduled to run overnight, even with screensaver disabled, it
essentially skipped over the SendKeys command and completed processing,
so that in the morning the email was displayed and ready to be sent.

Access 97, Outlook 2000, reference Outlook 10.0 Object Library...watch
for line wrap:
Public Sub SendEmail(strRecipients As String, strAttachment As String)
On Error GoTo Err_Handler

Dim olApp As Outlook.Application
Dim olMsg As Outlook.MailItem

Set olApp = CreateObject("Outlook.Application")
Set olMsg = olApp.CreateItem(olMailItem)

With olMsg
.To = strRecipients
.Subject = "Daily Reconciliation File"
.attachments.Add (strAttachment)
.display
End With

SendKeys "%S"

Exit_Handler:

Set olMsg = Nothing
Set olApp = Nothing

Exit Sub

Err_Handler:
MsgBox Err.Description, vbOKOnly, "Error #" & Err.Number
Resume Exit_Handler

End Sub

Apr 20 '06 #5

P: n/a
Arno, you are probably right - considering you are required to specify
an email (smtp) server... I'm working on a network with an exchange
server though, so that's not a problem here.
(you're using the "StopThisAdvertising" Profile today - are you and sir
PC Datasheet playing tom and jerry again?)

Rick - thanks for the hint... gave me the push in the right direction I
was looking for (I was starting to look at writing my own API wrapper
to WinSock - you saved me a trip to the shrink). I managed to put
together somthing that works for me from bits of code posted by Lyle,
Pat and Tony (Thanks guys!).

For the benefit of others trying to sort this out:

To send an email from Access using VBA without getting warning
messages:-
"A program is trying to send e-mail on your behalf. Do you want to
allow this? If this is unexpected, it may be a virus and you should
chose "no""
or
"A program is trying to access email addresses you have stored in
outlook. Do you want to allow this? If this is unexpected, it may be a
virus and you should chose "no""

Include the CDO library and use this:

Sub SendMail()

Dim iCfg As CDO.Configuration
Dim iMsg As CDO.Message

Set iCfg = New CDO.Configuration

With iCfg
.Fields(cdoSMTPServer) = "Name or IP of SMTP Server"
.Fields(cdoSMTPServerPort) = 25 ' Usual setting
.Fields(cdoSendUsingMethod) = cdoSendUsingPort
.Fields(cdoSMTPConnectionTimeout) = 200
.Fields.Update
End With

Set iMsg = New CDO.Message
With iMsg
Set .Configuration = iCfg
.Sender = "Ar********@Steve.not"
.Subject = "Test"
.TextBody = "This is a test"
.To = "Ar********@Steve.not"
.Send
End With

Set iMsg = Nothing
Set iCfg = Nothing

End Sub

Apr 20 '06 #6

P: n/a

"BillCo" <co**********@gmail.com> schreef in bericht news:11**********************@i39g2000cwa.googlegr oups.com...
(you're using the "StopThisAdvertising" Profile today - are you and sir
PC Datasheet playing tom and jerry again?)
Allready apologized for using the wrong account in the thread here
.Sender = "Ar********@Steve.not"

But I guess you are right in that I don't really love jobhunting Steve...
Arno R
Apr 20 '06 #7

P: n/a
StopThisAdvertising wrote:
I once tried CDO and noticed that one needs an open
InternetConnection to use it.
So you would need to check for a connection first or only use CDO
with a broadband (always open) connection.
Right/wrong?


I am not aware of any such requirement. You need to point it at an SMTP
server (which we have on our LAN).
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Apr 20 '06 #8

P: n/a
>But I guess you are right in that I don't really love jobhunting Steve...

I'm not a huge fan myself - as much as i do find it amusing when he
pops up giving wrong advice he robbed from somewhere that he
misunderstood... as an advertisement for himself! not so funny when
someone pays his services or subcontracts from him in good faith
though!!

Apr 21 '06 #9

P: n/a
Baz
"BillCo" <co**********@gmail.com> wrote in message
news:11*********************@j33g2000cwa.googlegro ups.com...
Hi folks,

I have an a2k ap which is called from a batch file via task scheduler
on at night - it runs a bunch of updates, imports stuff from other
databases and generally preps the main backend for another day's work.
It logs everything and generates an email which it sends to a few
people, issuing warnings if there were problems. Have you guessed the
problem yet?

Outlook 2003 / SP2 - "...Trying to send a mail...", "...use address
book..." messages. Usually I'd install outlook redemption, or a
different email client or something but since it's a banking
environment there are strict rules about software:

Can't reduce security in exchange
Can't install 3rd party patches to licenced software
etc, etc...

I need a solution!!!
- is there a way to bypass the email client and directly send an email
from the exchange server without bringing a tonne of warining messages
down on my head?
- failing that, are there any other solutions other people here have
used?


SendObject uses MAPI, which neatly bypasses the Outlook security messages.
It's a very simple solution, assuming that (i) it offers you enough
functionality and (ii) Outlook is the default mail client.

n.b. you don't have to send an object, you can easily use it to send email
without attachments.

Apr 22 '06 #10

P: n/a
the idea was to bypass outlook and connect directly to exchange.
sendobject is flaky and starts malfunctioning if it's used more than
once between outlook shutdown/restarts - its fairly well documented as
a bit of a desaster. Also, since it envokes the active outlook profile,
it triggers warning messages from exchange - which is what the problem
was in the first place.

I found a solution allowing connection to exchange via CDO without
envoking the outlook profile, which I posted. Working great so far!
(and looks like the basis of some potentially nasty spamware btw... why
ms would put such overkill warnings when using a legit outlook profile
without even the possibility of accepting signed aps automatically -
and then allow this gaping security hole is beyond me!)
-but thanks for the advice anyway :)

Apr 22 '06 #11

P: n/a
Baz

"BillCo" <co**********@gmail.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
the idea was to bypass outlook and connect directly to exchange.
You also asked for "any other solutions".
sendobject is flaky and starts malfunctioning if it's used more than
once between outlook shutdown/restarts - its fairly well documented as
a bit of a desaster. Also, since it envokes the active outlook profile,
it triggers warning messages from exchange - which is what the problem
was in the first place.

Works fine for me.
I found a solution allowing connection to exchange via CDO without
envoking the outlook profile, which I posted. Working great so far!
(and looks like the basis of some potentially nasty spamware btw... why
ms would put such overkill warnings when using a legit outlook profile
without even the possibility of accepting signed aps automatically -
and then allow this gaping security hole is beyond me!)
-but thanks for the advice anyway :)


For a solution which doesn't use an email client, I've been using this for
years, works really well:

http://www.freevbcode.com/ShowCode.Asp?ID=109

Also, the code can easily be converted to VBA if you want to avoid
distributing the dll.
Apr 22 '06 #12

P: n/a
> sendobject is flaky and starts malfunctioning if it's used more than

Unless you apply A2K SR3, A2K2 SR2

(david)

"BillCo" <co**********@gmail.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
the idea was to bypass outlook and connect directly to exchange.
sendobject is flaky and starts malfunctioning if it's used more than
once between outlook shutdown/restarts - its fairly well documented as
a bit of a desaster. Also, since it envokes the active outlook profile,
it triggers warning messages from exchange - which is what the problem
was in the first place.

I found a solution allowing connection to exchange via CDO without
envoking the outlook profile, which I posted. Working great so far!
(and looks like the basis of some potentially nasty spamware btw... why
ms would put such overkill warnings when using a legit outlook profile
without even the possibility of accepting signed aps automatically -
and then allow this gaping security hole is beyond me!)
-but thanks for the advice anyway :)

May 4 '06 #13

P: n/a
Really? I didn't know they'd fixed that! thanks...

May 4 '06 #14

P: n/a


"BillCo" <co**********@gmail.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Really? I didn't know they'd fixed that! thanks...


I think we were just lucky it fell out of a security fix.

Certainly it looks like the only reason the fix worked for
A2K was because it was included in a service release that
was required for a security patch. And the flaw had been
around for a long time without any indication that there
was any intention to do anything about it.

(david)
May 5 '06 #15

This discussion thread is closed

Replies have been disabled for this discussion.