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

programatically sending email

P: n/a
Right guys.

(I would like a solution to this in VB6 as this is what our needy app is
written in, but any solutions that involve .NET would be much appreciated
likewise as I could instantiate them, otherwise please forgive the
crossposting.)

I'm sure I've seen posts here before criticising the practice of automating
outlook for the purpose of programatically sending email, on the grounds that
it's naff. Well now we're really landed in it, it's more than naff. The IT
department have applied some security patch, and it means that a guy in our
department now has to sit there for about 10 minutes constantly clicking
"yes" to the message box that pops up saying "an external program is trying
to use outlook to send email, do you want to allow this?, blah blah blah".
So I desparately NEED to find a way of sending email without using outlook,
and I haven't got the foggiest! I've heard of something called "MIME" - is
this a load of API functions I need to be using?
One other thing - the configuration. It's dead easy to set up outlook in our
network - when loading the profile for the first time, you just tell it the
name of the exchange server to connect to (which we don't have control over)
and it picks it up. Can MIME (if that's the technology I need to be using)
connect to an exchange server?

I'm sure I could understand it once I knew the general structure, so any
links to the basics would be much appreciated, aswell as people's experience
with common pitfalls. No third party controls if possible, as our IT
department have to authorise things like that and they are mightily
suspicious of them.
But it would sure impress people if I could program our way out of this
stupid corner that IT have boxed us into, so any help is much appreciated!

Thanks
Nov 16 '05 #1
Share this Question
Share on Google+
17 Replies


P: n/a
"Bonj" <Bo**@discussions.microsoft.com> schrieb:
So I desparately NEED to find a way of sending email
without using outlook, and I haven't got the foggiest!
Sending and receiving email
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=email&lang=en>
I've heard of something called "MIME" - is
this a load of API functions I need to be using?


MIME is used for encoding mail attachments, for example.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 16 '05 #2

P: n/a
Bonj,

See inline:

I've heard of something called "MIME" - is
this a load of API functions I need to be using?
MIME is short for Multipurpose Internet Mail Extension (I believe). It
is a way of formatting content in messages, it's not a protocol for sending
them.
One other thing - the configuration. It's dead easy to set up outlook in
our
network - when loading the profile for the first time, you just tell it
the
name of the exchange server to connect to (which we don't have control
over)
and it picks it up. Can MIME (if that's the technology I need to be using)
connect to an exchange server?
If your exchange server supports the IMAP or POP3 protocols, I would
suggest looking at the Indy Project:

http://www.indyproject.org

It has a number of classes that you can use to send/receive mail. The
thing is, it won't connect to Exchange directly, so you will have to connect
through the POP3 or IMAP connector.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
I'm sure I could understand it once I knew the general structure, so any
links to the basics would be much appreciated, aswell as people's
experience
with common pitfalls. No third party controls if possible, as our IT
department have to authorise things like that and they are mightily
suspicious of them.
But it would sure impress people if I could program our way out of this
stupid corner that IT have boxed us into, so any help is much appreciated!

Thanks

Nov 16 '05 #3

P: n/a
Bonj
To avoid the Outlook security prompts its generally easiest to create a
properly constructed COM-Addin for Outlook 2003. There are other methods
available for other versions of Outlook...

See:
http://msdn.microsoft.com/library/de...scomaddins.asp

Further info can be found at:
http://www.slipstick.com/dev/ol2003problems.htm
http://www.slipstick.com/outlook/esecup/admin.htm

Hope this helps
Jay
"Bonj" <Bo**@discussions.microsoft.com> wrote in message
news:A3**********************************@microsof t.com...
Right guys.

(I would like a solution to this in VB6 as this is what our needy app is
written in, but any solutions that involve .NET would be much appreciated
likewise as I could instantiate them, otherwise please forgive the
crossposting.)

I'm sure I've seen posts here before criticising the practice of
automating
outlook for the purpose of programatically sending email, on the grounds
that
it's naff. Well now we're really landed in it, it's more than naff. The IT
department have applied some security patch, and it means that a guy in
our
department now has to sit there for about 10 minutes constantly clicking
"yes" to the message box that pops up saying "an external program is
trying
to use outlook to send email, do you want to allow this?, blah blah blah".
So I desparately NEED to find a way of sending email without using
outlook,
and I haven't got the foggiest! I've heard of something called "MIME" - is
this a load of API functions I need to be using?
One other thing - the configuration. It's dead easy to set up outlook in
our
network - when loading the profile for the first time, you just tell it
the
name of the exchange server to connect to (which we don't have control
over)
and it picks it up. Can MIME (if that's the technology I need to be using)
connect to an exchange server?

I'm sure I could understand it once I knew the general structure, so any
links to the basics would be much appreciated, aswell as people's
experience
with common pitfalls. No third party controls if possible, as our IT
department have to authorise things like that and they are mightily
suspicious of them.
But it would sure impress people if I could program our way out of this
stupid corner that IT have boxed us into, so any help is much appreciated!

Thanks

Nov 16 '05 #4

P: n/a

"Bonj" <Bo**@discussions.microsoft.com> wrote in message
news:A3**********************************@microsof t.com...
Right guys.

(I would like a solution to this in VB6 as this is what our needy app is
written in, but any solutions that involve .NET would be much appreciated
likewise as I could instantiate them, otherwise please forgive the
crossposting.)

I'm sure I've seen posts here before criticising the practice of automating outlook for the purpose of programatically sending email, on the grounds that it's naff. Well now we're really landed in it, it's more than naff. The IT
department have applied some security patch, and it means that a guy in our department now has to sit there for about 10 minutes constantly clicking
"yes" to the message box that pops up saying "an external program is trying to use outlook to send email, do you want to allow this?, blah blah blah".
So I desparately NEED to find a way of sending email without using outlook, and I haven't got the foggiest! I've heard of something called "MIME" - is
this a load of API functions I need to be using?
One other thing - the configuration. It's dead easy to set up outlook in our network - when loading the profile for the first time, you just tell it the name of the exchange server to connect to (which we don't have control over) and it picks it up. Can MIME (if that's the technology I need to be using)
connect to an exchange server?

I'm sure I could understand it once I knew the general structure, so any
links to the basics would be much appreciated, aswell as people's experience with common pitfalls. No third party controls if possible, as our IT
department have to authorise things like that and they are mightily
suspicious of them.
But it would sure impress people if I could program our way out of this
stupid corner that IT have boxed us into, so any help is much appreciated!

Thanks


I would ask the IT department how to deal with the problem since THEY are
causing it and preventing YOU from doing your job.
Why should you (and your department) have to spent time (and hence money)
because another department is imposing it's own rules.
The IT department is suppose to help its users, not hinder them!!

John..
Nov 16 '05 #5

P: n/a
Nicholas Paldino [.NET/C# MVP] wrote:

It has a number of classes that you can use to send/receive mail. The
thing is, it won't connect to Exchange directly, so you will have to connect
through the POP3 or IMAP connector.

POP3 and IMAP are protocols for receiving mail,
I don't think they'd be much help with sending.

Bob
--
Nov 16 '05 #6

P: n/a
"Nospam" <no****@please.co.uk> wrote in message
news:41***********************@news.easynet.co.uk. ..

"Bonj" <Bo**@discussions.microsoft.com> wrote in message
news:A3**********************************@microsof t.com...
Right guys.

(I would like a solution to this in VB6 as this is what our needy app is
written in, but any solutions that involve .NET would be much appreciated likewise as I could instantiate them, otherwise please forgive the
crossposting.)

I'm sure I've seen posts here before criticising the practice of

automating
outlook for the purpose of programatically sending email, on the grounds

that
it's naff. Well now we're really landed in it, it's more than naff. The IT department have applied some security patch, and it means that a guy in

our
department now has to sit there for about 10 minutes constantly clicking
"yes" to the message box that pops up saying "an external program is

trying
to use outlook to send email, do you want to allow this?, blah blah blah". So I desparately NEED to find a way of sending email without using

outlook,
and I haven't got the foggiest! I've heard of something called "MIME" - is this a load of API functions I need to be using?
One other thing - the configuration. It's dead easy to set up outlook in

our
network - when loading the profile for the first time, you just tell it

the
name of the exchange server to connect to (which we don't have control

over)
and it picks it up. Can MIME (if that's the technology I need to be using) connect to an exchange server?

I'm sure I could understand it once I knew the general structure, so any
links to the basics would be much appreciated, aswell as people's

experience
with common pitfalls. No third party controls if possible, as our IT
department have to authorise things like that and they are mightily
suspicious of them.
But it would sure impress people if I could program our way out of this
stupid corner that IT have boxed us into, so any help is much appreciated!
Thanks


I would ask the IT department how to deal with the problem since THEY are
causing it and preventing YOU from doing your job.
Why should you (and your department) have to spent time (and hence money)
because another department is imposing it's own rules.
The IT department is suppose to help its users, not hinder them!!

John..


The box that is a problem is a "feature" Microsoft added to later versions
of Outlook 2000 security patches. This anonying feature was implimented to
prevent script based virii from mass mailing.

While I can say that the box is anonying, I'd much rather deal with it then
leave a system open to virus attacks since it's not properly maintained.

Here is the response I sent to Terry Holland about this very subject earlier
today:

The first option that comes to mind is for you to use CDO to directly access
Outlook and avoid the nice interface you are using. Note that CDO is a pain
to code in. The another option is to use a program called Outlook
Redemption (http://www.dimastr.com/redemption/), using this will allow you
to use the code you have already written with very few changes. I used it a
few years ago and it wasn't too expensive, had a lenient license, and the
creator was very helpful and quick at responding to questions. The final
option is to access the popup box from VB and sendkey commands to it to
automatically close it.

Outlook Redemption is really the best solution in my eyes; however, you
could use SendKeys. It's messing and definately not proper coding in my
eyes, but it will get the job none without a 3rd party program.
Nov 16 '05 #7

P: n/a
Paul,
The first option that comes to mind is for you to use CDO to directly
access
Outlook and avoid the nice interface you are using. Note that CDO is a
pain
to code in. The another option is to use a program called Outlook
Redemption (http://www.dimastr.com/redemption/), using this will allow you Note: CDO 1.2.1 that ships with current versions of Outlook has the same
security feature.

Hope this helps
Jay

"Paul Bobrowski" <no****@msdiscussion.com> wrote in message
news:Ox****************@TK2MSFTNGP14.phx.gbl... "Nospam" <no****@please.co.uk> wrote in message
news:41***********************@news.easynet.co.uk. ..

"Bonj" <Bo**@discussions.microsoft.com> wrote in message
news:A3**********************************@microsof t.com...
> Right guys.
>
> (I would like a solution to this in VB6 as this is what our needy app
> is
> written in, but any solutions that involve .NET would be much appreciated > likewise as I could instantiate them, otherwise please forgive the
> crossposting.)
>
> I'm sure I've seen posts here before criticising the practice of

automating
> outlook for the purpose of programatically sending email, on the
> grounds

that
> it's naff. Well now we're really landed in it, it's more than naff. The IT > department have applied some security patch, and it means that a guy in

our
> department now has to sit there for about 10 minutes constantly
> clicking
> "yes" to the message box that pops up saying "an external program is

trying
> to use outlook to send email, do you want to allow this?, blah blah blah". > So I desparately NEED to find a way of sending email without using

outlook,
> and I haven't got the foggiest! I've heard of something called "MIME" - is > this a load of API functions I need to be using?
> One other thing - the configuration. It's dead easy to set up outlook
> in

our
> network - when loading the profile for the first time, you just tell it

the
> name of the exchange server to connect to (which we don't have control

over)
> and it picks it up. Can MIME (if that's the technology I need to be using) > connect to an exchange server?
>
> I'm sure I could understand it once I knew the general structure, so
> any
> links to the basics would be much appreciated, aswell as people's

experience
> with common pitfalls. No third party controls if possible, as our IT
> department have to authorise things like that and they are mightily
> suspicious of them.
> But it would sure impress people if I could program our way out of this
> stupid corner that IT have boxed us into, so any help is much appreciated! >
> Thanks


I would ask the IT department how to deal with the problem since THEY are
causing it and preventing YOU from doing your job.
Why should you (and your department) have to spent time (and hence money)
because another department is imposing it's own rules.
The IT department is suppose to help its users, not hinder them!!

John..


The box that is a problem is a "feature" Microsoft added to later versions
of Outlook 2000 security patches. This anonying feature was implimented
to
prevent script based virii from mass mailing.

While I can say that the box is anonying, I'd much rather deal with it
then
leave a system open to virus attacks since it's not properly maintained.

Here is the response I sent to Terry Holland about this very subject
earlier
today:

The first option that comes to mind is for you to use CDO to directly
access
Outlook and avoid the nice interface you are using. Note that CDO is a
pain
to code in. The another option is to use a program called Outlook
Redemption (http://www.dimastr.com/redemption/), using this will allow you
to use the code you have already written with very few changes. I used it
a
few years ago and it wasn't too expensive, had a lenient license, and the
creator was very helpful and quick at responding to questions. The final
option is to access the popup box from VB and sendkey commands to it to
automatically close it.

Outlook Redemption is really the best solution in my eyes; however, you
could use SendKeys. It's messing and definately not proper coding in my
eyes, but it will get the job none without a 3rd party program.

Nov 16 '05 #8

P: n/a
It also supports SMTP, I think that was what I was going for.

Thanks for the correction.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Bob O`Bob" <fi*******@yahoogroups.com> wrote in message
news:u5**************@TK2MSFTNGP10.phx.gbl...
Nicholas Paldino [.NET/C# MVP] wrote:

It has a number of classes that you can use to send/receive mail.
The thing is, it won't connect to Exchange directly, so you will have to
connect through the POP3 or IMAP connector.

POP3 and IMAP are protocols for receiving mail,
I don't think they'd be much help with sending.

Bob
--

Nov 16 '05 #9

P: n/a
Thanks a lot all...I'll check out some of the links and see if anything can
be done.
I think I meant "MAPI", not "MIME" - picked the wrong acronym, sorry! I'm
not actually at all interested in encoding any mail...
"Bonj" <Bo**@discussions.microsoft.com> wrote in message
news:A3**********************************@microsof t.com...
Right guys.

(I would like a solution to this in VB6 as this is what our needy app is
written in, but any solutions that involve .NET would be much appreciated
likewise as I could instantiate them, otherwise please forgive the
crossposting.)

I'm sure I've seen posts here before criticising the practice of
automating
outlook for the purpose of programatically sending email, on the grounds
that
it's naff. Well now we're really landed in it, it's more than naff. The IT
department have applied some security patch, and it means that a guy in
our
department now has to sit there for about 10 minutes constantly clicking
"yes" to the message box that pops up saying "an external program is
trying
to use outlook to send email, do you want to allow this?, blah blah blah".
So I desparately NEED to find a way of sending email without using
outlook,
and I haven't got the foggiest! I've heard of something called "MIME" - is
this a load of API functions I need to be using?
One other thing - the configuration. It's dead easy to set up outlook in
our
network - when loading the profile for the first time, you just tell it
the
name of the exchange server to connect to (which we don't have control
over)
and it picks it up. Can MIME (if that's the technology I need to be using)
connect to an exchange server?

I'm sure I could understand it once I knew the general structure, so any
links to the basics would be much appreciated, aswell as people's
experience
with common pitfalls. No third party controls if possible, as our IT
department have to authorise things like that and they are mightily
suspicious of them.
But it would sure impress people if I could program our way out of this
stupid corner that IT have boxed us into, so any help is much appreciated!

Thanks

Nov 16 '05 #10

P: n/a
some solutions

1. u can use a software called "Express ClickYes" from www.contextmagic.com
, It will bypass those security boxes that pop up in outlook

2. Use vbsendmail.ddl component for sending mails .. it's very simple to use
http://www.freevbcode.com/ShowCode.Asp?ID=109

--
Gaurav Creations

"Bonj" wrote:
Right guys.

(I would like a solution to this in VB6 as this is what our needy app is
written in, but any solutions that involve .NET would be much appreciated
likewise as I could instantiate them, otherwise please forgive the
crossposting.)

I'm sure I've seen posts here before criticising the practice of automating
outlook for the purpose of programatically sending email, on the grounds that
it's naff. Well now we're really landed in it, it's more than naff. The IT
department have applied some security patch, and it means that a guy in our
department now has to sit there for about 10 minutes constantly clicking
"yes" to the message box that pops up saying "an external program is trying
to use outlook to send email, do you want to allow this?, blah blah blah".
So I desparately NEED to find a way of sending email without using outlook,
and I haven't got the foggiest! I've heard of something called "MIME" - is
this a load of API functions I need to be using?
One other thing - the configuration. It's dead easy to set up outlook in our
network - when loading the profile for the first time, you just tell it the
name of the exchange server to connect to (which we don't have control over)
and it picks it up. Can MIME (if that's the technology I need to be using)
connect to an exchange server?

I'm sure I could understand it once I knew the general structure, so any
links to the basics would be much appreciated, aswell as people's experience
with common pitfalls. No third party controls if possible, as our IT
department have to authorise things like that and they are mightily
suspicious of them.
But it would sure impress people if I could program our way out of this
stupid corner that IT have boxed us into, so any help is much appreciated!

Thanks

Nov 16 '05 #11

P: n/a
That's a very very good point, and is nice to hear....

"Nospam" <no****@please.co.uk> wrote in message
news:41***********************@news.easynet.co.uk. ..

"Bonj" <Bo**@discussions.microsoft.com> wrote in message
news:A3**********************************@microsof t.com...
Right guys.

(I would like a solution to this in VB6 as this is what our needy app is
written in, but any solutions that involve .NET would be much appreciated
likewise as I could instantiate them, otherwise please forgive the
crossposting.)

I'm sure I've seen posts here before criticising the practice of

automating
outlook for the purpose of programatically sending email, on the grounds

that
it's naff. Well now we're really landed in it, it's more than naff. The
IT
department have applied some security patch, and it means that a guy in

our
department now has to sit there for about 10 minutes constantly clicking
"yes" to the message box that pops up saying "an external program is

trying
to use outlook to send email, do you want to allow this?, blah blah
blah".
So I desparately NEED to find a way of sending email without using

outlook,
and I haven't got the foggiest! I've heard of something called "MIME" -
is
this a load of API functions I need to be using?
One other thing - the configuration. It's dead easy to set up outlook in

our
network - when loading the profile for the first time, you just tell it

the
name of the exchange server to connect to (which we don't have control

over)
and it picks it up. Can MIME (if that's the technology I need to be
using)
connect to an exchange server?

I'm sure I could understand it once I knew the general structure, so any
links to the basics would be much appreciated, aswell as people's

experience
with common pitfalls. No third party controls if possible, as our IT
department have to authorise things like that and they are mightily
suspicious of them.
But it would sure impress people if I could program our way out of this
stupid corner that IT have boxed us into, so any help is much
appreciated!

Thanks


I would ask the IT department how to deal with the problem since THEY are
causing it and preventing YOU from doing your job.
Why should you (and your department) have to spent time (and hence money)
because another department is imposing it's own rules.
The IT department is suppose to help its users, not hinder them!!

John..

Nov 16 '05 #12

P: n/a
Hi
Thanks for all the replies, I managed to get it to work using CDO, via the
System.Web.Mail namespace, however it will only send a mail from a machine
that has got IIS SMTP server running on it, and if I stop it, then it still
works - but the mail only arrives when the SMTP server is restarted. Using
Smtp.SmtpServer property (Insert or just plain setting it) doesn't seem to
affect the out come at all.
Does anybody know how I can get it to use a particular exchange server (that
we don't have control over) whether IIS is installed locally or not?

"Bonj" wrote:
Right guys.

(I would like a solution to this in VB6 as this is what our needy app is
written in, but any solutions that involve .NET would be much appreciated
likewise as I could instantiate them, otherwise please forgive the
crossposting.)

I'm sure I've seen posts here before criticising the practice of automating
outlook for the purpose of programatically sending email, on the grounds that
it's naff. Well now we're really landed in it, it's more than naff. The IT
department have applied some security patch, and it means that a guy in our
department now has to sit there for about 10 minutes constantly clicking
"yes" to the message box that pops up saying "an external program is trying
to use outlook to send email, do you want to allow this?, blah blah blah".
So I desparately NEED to find a way of sending email without using outlook,
and I haven't got the foggiest! I've heard of something called "MIME" - is
this a load of API functions I need to be using?
One other thing - the configuration. It's dead easy to set up outlook in our
network - when loading the profile for the first time, you just tell it the
name of the exchange server to connect to (which we don't have control over)
and it picks it up. Can MIME (if that's the technology I need to be using)
connect to an exchange server?

I'm sure I could understand it once I knew the general structure, so any
links to the basics would be much appreciated, aswell as people's experience
with common pitfalls. No third party controls if possible, as our IT
department have to authorise things like that and they are mightily
suspicious of them.
But it would sure impress people if I could program our way out of this
stupid corner that IT have boxed us into, so any help is much appreciated!

Thanks

Nov 16 '05 #13

P: n/a
Here's some code I used once upon a time (in VB5):

MAPISession1.NewSession = False
MAPISession1.LogonUI = False
MAPISession1.DownLoadMail = False
MAPISession1.UserName = vbNullString
MAPISession1.SignOn

MAPIMessages1.SessionID = MAPISession1.SessionID
MAPIMessages1.MsgIndex = -1
MAPIMessages1.Compose
MAPIMessages1.RecipDisplayName = eMailAddress$
MAPIMessages1.MsgSubject = "Message From My Program!"

X$ = "Testing, testing, 1 , 2, 3" & vbCrLf
X$ = X$ & "This is line #2" & vbCrLf
X$ = X$ & "Etc." & vbCrLf

MAPIMessages1.MsgNoteText = X$
MAPIMessages1.Send False

DoEvents

MAPISession1.SignOff

On Wed, 3 Nov 2004 09:18:07 -0800, "Bonj"
<Bo**@discussions.microsoft.com> wrote:
Right guys.

(I would like a solution to this in VB6 as this is what our needy app is
written in, but any solutions that involve .NET would be much appreciated
likewise as I could instantiate them, otherwise please forgive the
crossposting.)

I'm sure I've seen posts here before criticising the practice of automating
outlook for the purpose of programatically sending email, on the grounds that
it's naff. Well now we're really landed in it, it's more than naff. The IT
department have applied some security patch, and it means that a guy in our
department now has to sit there for about 10 minutes constantly clicking
"yes" to the message box that pops up saying "an external program is trying
to use outlook to send email, do you want to allow this?, blah blah blah".
So I desparately NEED to find a way of sending email without using outlook,
and I haven't got the foggiest! I've heard of something called "MIME" - is
this a load of API functions I need to be using?
One other thing - the configuration. It's dead easy to set up outlook in our
network - when loading the profile for the first time, you just tell it the
name of the exchange server to connect to (which we don't have control over)
and it picks it up. Can MIME (if that's the technology I need to be using)
connect to an exchange server?

I'm sure I could understand it once I knew the general structure, so any
links to the basics would be much appreciated, aswell as people's experience
with common pitfalls. No third party controls if possible, as our IT
department have to authorise things like that and they are mightily
suspicious of them.
But it would sure impress people if I could program our way out of this
stupid corner that IT have boxed us into, so any help is much appreciated!

Thanks


Nov 16 '05 #14

P: n/a
Whoops... :(

I just tried this (using the program I took the code from) and was
surprised to see that the warning you're trying to avoid popped up. I
had never seen this before (its been several years since I used this).

I guess this code won't help you at all.

Sorry.
On Thu, 04 Nov 2004 05:40:59 -0700, Martin <ma**********@comcast.net>
wrote:
Here's some code I used once upon a time (in VB5):

MAPISession1.NewSession = False
MAPISession1.LogonUI = False
MAPISession1.DownLoadMail = False
MAPISession1.UserName = vbNullString
MAPISession1.SignOn

MAPIMessages1.SessionID = MAPISession1.SessionID
MAPIMessages1.MsgIndex = -1
MAPIMessages1.Compose
MAPIMessages1.RecipDisplayName = eMailAddress$
MAPIMessages1.MsgSubject = "Message From My Program!"

X$ = "Testing, testing, 1 , 2, 3" & vbCrLf
X$ = X$ & "This is line #2" & vbCrLf
X$ = X$ & "Etc." & vbCrLf

MAPIMessages1.MsgNoteText = X$
MAPIMessages1.Send False

DoEvents

MAPISession1.SignOff

On Wed, 3 Nov 2004 09:18:07 -0800, "Bonj"
<Bo**@discussions.microsoft.com> wrote:
Right guys.

(I would like a solution to this in VB6 as this is what our needy app is
written in, but any solutions that involve .NET would be much appreciated
likewise as I could instantiate them, otherwise please forgive the
crossposting.)

I'm sure I've seen posts here before criticising the practice of automating
outlook for the purpose of programatically sending email, on the grounds that
it's naff. Well now we're really landed in it, it's more than naff. The IT
department have applied some security patch, and it means that a guy in our
department now has to sit there for about 10 minutes constantly clicking
"yes" to the message box that pops up saying "an external program is trying
to use outlook to send email, do you want to allow this?, blah blah blah".
So I desparately NEED to find a way of sending email without using outlook,
and I haven't got the foggiest! I've heard of something called "MIME" - is
this a load of API functions I need to be using?
One other thing - the configuration. It's dead easy to set up outlook in our
network - when loading the profile for the first time, you just tell it the
name of the exchange server to connect to (which we don't have control over)
and it picks it up. Can MIME (if that's the technology I need to be using)
connect to an exchange server?

I'm sure I could understand it once I knew the general structure, so any
links to the basics would be much appreciated, aswell as people's experience
with common pitfalls. No third party controls if possible, as our IT
department have to authorise things like that and they are mightily
suspicious of them.
But it would sure impress people if I could program our way out of this
stupid corner that IT have boxed us into, so any help is much appreciated!

Thanks


Nov 16 '05 #15

P: n/a
Oh, really! - does it!

That's good to know - I'll not go down that road then

I'm really trying to get it to work by using CDO without having IIS
installed on the machine, but it doesn't matter if it does because a lot of
the machines have got IIS installed.

Cheers anyway
"Martin" wrote:
Whoops... :(

I just tried this (using the program I took the code from) and was
surprised to see that the warning you're trying to avoid popped up. I
had never seen this before (its been several years since I used this).

I guess this code won't help you at all.

Sorry.
On Thu, 04 Nov 2004 05:40:59 -0700, Martin <ma**********@comcast.net>
wrote:
Here's some code I used once upon a time (in VB5):

MAPISession1.NewSession = False
MAPISession1.LogonUI = False
MAPISession1.DownLoadMail = False
MAPISession1.UserName = vbNullString
MAPISession1.SignOn

MAPIMessages1.SessionID = MAPISession1.SessionID
MAPIMessages1.MsgIndex = -1
MAPIMessages1.Compose
MAPIMessages1.RecipDisplayName = eMailAddress$
MAPIMessages1.MsgSubject = "Message From My Program!"

X$ = "Testing, testing, 1 , 2, 3" & vbCrLf
X$ = X$ & "This is line #2" & vbCrLf
X$ = X$ & "Etc." & vbCrLf

MAPIMessages1.MsgNoteText = X$
MAPIMessages1.Send False

DoEvents

MAPISession1.SignOff

On Wed, 3 Nov 2004 09:18:07 -0800, "Bonj"
<Bo**@discussions.microsoft.com> wrote:
Right guys.

(I would like a solution to this in VB6 as this is what our needy app is
written in, but any solutions that involve .NET would be much appreciated
likewise as I could instantiate them, otherwise please forgive the
crossposting.)

I'm sure I've seen posts here before criticising the practice of automating
outlook for the purpose of programatically sending email, on the grounds that
it's naff. Well now we're really landed in it, it's more than naff. The IT
department have applied some security patch, and it means that a guy in our
department now has to sit there for about 10 minutes constantly clicking
"yes" to the message box that pops up saying "an external program is trying
to use outlook to send email, do you want to allow this?, blah blah blah".
So I desparately NEED to find a way of sending email without using outlook,
and I haven't got the foggiest! I've heard of something called "MIME" - is
this a load of API functions I need to be using?
One other thing - the configuration. It's dead easy to set up outlook in our
network - when loading the profile for the first time, you just tell it the
name of the exchange server to connect to (which we don't have control over)
and it picks it up. Can MIME (if that's the technology I need to be using)
connect to an exchange server?

I'm sure I could understand it once I knew the general structure, so any
links to the basics would be much appreciated, aswell as people's experience
with common pitfalls. No third party controls if possible, as our IT
department have to authorise things like that and they are mightily
suspicious of them.
But it would sure impress people if I could program our way out of this
stupid corner that IT have boxed us into, so any help is much appreciated!

Thanks


Nov 16 '05 #16

P: n/a

"Bonj" <Bo**@discussions.microsoft.com> wrote in message
news:76**********************************@microsof t.com...
Hi
Thanks for all the replies, I managed to get it to work using CDO, via the
System.Web.Mail namespace, however it will only send a mail from a machine
that has got IIS SMTP server running on it, and if I stop it, then it still works - but the mail only arrives when the SMTP server is restarted. Using
Smtp.SmtpServer property (Insert or just plain setting it) doesn't seem to
affect the out come at all.
Does anybody know how I can get it to use a particular exchange server (that we don't have control over) whether IIS is installed locally or not?

"Bonj" wrote:


I was hesitant to offer a reply as we resolved this problem somewhat
differently. We had a client that was running a suite of applications that
utilized email services. They broke for very much the reasons you listed. We
punted and implemented a COM+ messaging service. Notifications to send an
email were then sent to a central service which had its own email account.

hth
-ralph
Nov 16 '05 #17

P: n/a
Ralph (& Bonj),
I was at a client earlier this year that did the same thing. They set up a
Web Service that would send an email, which in many ways makes sense. As you
do not need to open up or manage allot of machines with the CDONTS or CDOSYS
on them. You can simply manage a single machine with CDOSYS on it. Allowing
better control in the fight against viruses, worms & other things
potentially infecting the networks...

They also had a special Queue they could use for Message Queuing
applications (MQ Series, MSMQ)...

Hope this helps
Jay

"Ralph" <ms***********************@spamgourmet.com> wrote in message
news:ef**************@TK2MSFTNGP10.phx.gbl...

"Bonj" <Bo**@discussions.microsoft.com> wrote in message
news:76**********************************@microsof t.com...
Hi
Thanks for all the replies, I managed to get it to work using CDO, via
the
System.Web.Mail namespace, however it will only send a mail from a
machine
that has got IIS SMTP server running on it, and if I stop it, then it

still
works - but the mail only arrives when the SMTP server is restarted.
Using
Smtp.SmtpServer property (Insert or just plain setting it) doesn't seem
to
affect the out come at all.
Does anybody know how I can get it to use a particular exchange server

(that
we don't have control over) whether IIS is installed locally or not?

"Bonj" wrote:


I was hesitant to offer a reply as we resolved this problem somewhat
differently. We had a client that was running a suite of applications that
utilized email services. They broke for very much the reasons you listed.
We
punted and implemented a COM+ messaging service. Notifications to send an
email were then sent to a central service which had its own email account.

hth
-ralph

Nov 16 '05 #18

This discussion thread is closed

Replies have been disabled for this discussion.