473,387 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

programatically sending email

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
17 2865
"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
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
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

"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
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
"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
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
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
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
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
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
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
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
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
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

"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Paul Lamonby | last post by:
Hi, I am sending a file from the server as an email attachment. The file is being attached no problem and sending the email, but I get an error when I try to open it saying it is corrupt....
13
by: joe215 | last post by:
I want my users to send emails from a Windows app that I am developing in Visual Basic.NET 2003. I found a good example of sending email to a SMTP server using the SmtpMail class. However, using...
17
by: Bonj | last post by:
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...
31
by: happyse27 | last post by:
Hi All, I am trying for weeks how to send email from windows pc, which from my gmail account to my hotmail account. Using net::smtp module sending email failed,Kindly assist. (for the item d it...
6
by: Chocolade | last post by:
Hi, Im using System.Net.Mail to send email in my application it was working great without any problems untill this morning after like 20-30 tries it was sending the email ok then suddenly this...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.