[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Outlook, MAPI, Sending Mail

Jade Tucker

8/18/2008 10:27:00 PM

Hi All,

I am trying to write a program to test that our email servers are
working properly.

I have a ruby program to send an email from a MS Outlook inbox connected
to an exchange mail server. The program using WIN32OLE to connect to
Outlook. The program sends an email to another email account (out of
our network) that is setup to automatically send back the email. My
program then waits for the email to return for a max of 5 minutes before
it will fail.

The first issue I encountered was Outlook poping up a dialog box warning
me that a program was trying to send an email on my behalf. With
Outlook 2007 I was able to disable this security restriction.

This program needs to run on a server without anyone logged in. For
some reason this is not working as a scheduled task set to run under the
user the email account is setup for.

I am looking for any help or advice on how to get this working. I am
getting frustrated with developing applications that run fine normaly,
but as soon as I try to run them on a schedule or invoked remotely they
start breaking.

Does anyone know of a better way to do this or can help me with my
problem?

Thanks,
JT
--
Posted via http://www.ruby-....

26 Answers

Jeff Miller

8/19/2008 12:22:00 AM

0

Jade Tucker wrote:
> Hi All,
>
Hey there,
I had to develop an application that had to interact with Outlook quite
a bit - however, I recommend that you use MAPI/CDO via the Exchange side
rather than through client-side outlook, since you have less
dependencies and a less likely chance of it breaking. Check out some VB
examples from CDOlive.com and outlookcode.com . There is great help
there.

Good luck,
- Jeff Miller

> I am trying to write a program to test that our email servers are
> working properly.
>
> I have a ruby program to send an email from a MS Outlook inbox connected
> to an exchange mail server. The program using WIN32OLE to connect to
> Outlook. The program sends an email to another email account (out of
> our network) that is setup to automatically send back the email. My
> program then waits for the email to return for a max of 5 minutes before
> it will fail.
>
> The first issue I encountered was Outlook poping up a dialog box warning
> me that a program was trying to send an email on my behalf. With
> Outlook 2007 I was able to disable this security restriction.
>
> This program needs to run on a server without anyone logged in. For
> some reason this is not working as a scheduled task set to run under the
> user the email account is setup for.
>
> I am looking for any help or advice on how to get this working. I am
> getting frustrated with developing applications that run fine normaly,
> but as soon as I try to run them on a schedule or invoked remotely they
> start breaking.
>
> Does anyone know of a better way to do this or can help me with my
> problem?
>
> Thanks,
> JT

--
Posted via http://www.ruby-....

Peña, Botp

8/19/2008 10:29:00 AM

0

RnJvbTogSmFkZSBUdWNrZXIgW21haWx0bzpqdHVja2VyQHhvamV0LmNvbV0gDQojIEkgYW0gdHJ5
aW5nIHRvIHdyaXRlIGEgcHJvZ3JhbSB0byB0ZXN0IHRoYXQgb3VyIGVtYWlsIHNlcnZlcnMgYXJl
DQojIHdvcmtpbmcgcHJvcGVybHkuIEkgaGF2ZSBhIHJ1YnkgcHJvZ3JhbSB0byBzZW5kIGFuIGVt
YWlsIGZyb20gYSBNUw0KIyBPdXRsb29rIGluYm94IGNvbm5lY3RlZCB0byBhbiBleGNoYW5nZSBt
YWlsIHNlcnZlci4gIFRoZSBwcm9ncmFtIHVzaW5nIA0KDQpqdXN0IHVzZSBydWJ5J3MgbmV0L3Nt
dHAgYW5kIHlvdXIgZmluZS4gaW4gZmFjdCwgc2luY2UgeW91J3JlIGNvZGluZyBpdCwgeW91IGNh
biBkbyBhIG1vcmUgZ3JhbnVsYXIgY2hlY2tpbmcgb2YgeW91ciBzZXJ2ZXJzIGJ5DQoNCmEuIGNo
ZWNraW5nIGNvbm5lY3Rpb24gdGhydSBwaW5nDQpiLiBjaGVja2luZyBzZXJ2aWNlIHRocnUgcG9y
dCAyNQ0KYy4gY2hlY2tpbmcgZW1haWwgZnhuYWxpdHkgYnkgc2VuZGluZyBhbiBlbWFpbC4gZm9y
IGEgc2FtcGxlLCBzZWUgbXkgbGFzdCBwb3N0IGhlcmUgaHR0cDovL2dyb3Vwcy5nb29nbGUuY29t
L2dyb3VwL3J1YnktdGFsay1nb29nbGUvYnJvd3NlX3RocmVhZC90aHJlYWQvOTU3ZGM1YTNiMTcz
ODlhYw0KDQpraW5kIHJlZ2FyZHMgLWJvdHANCg0KDQoNCg0KDQo=

Glen Holcomb

8/19/2008 2:21:00 PM

0

On Tue, Aug 19, 2008 at 4:28 AM, Pe=F1a, Botp <botp@delmonte-phil.com> wrot=
e:

> From: Jade Tucker [mailto:jtucker@xojet.com]
> # I am trying to write a program to test that our email servers are
> # working properly. I have a ruby program to send an email from a MS
> # Outlook inbox connected to an exchange mail server. The program using
>
> just use ruby's net/smtp and your fine. in fact, since you're coding it,
> you can do a more granular checking of your servers by
>
> a. checking connection thru ping
> b. checking service thru port 25
> c. checking email fxnality by sending an email. for a sample, see my last
> post here
> http://groups.google.com/group/ruby-talk-google/browse_thread/th...
c5a3b17389ac
>
> kind regards -botp
>
>
>
>
>
>
Small qualifier here. Outlook doesn't always do SMTP, it can be turned off
by the more Evangelical MS Admins.

--=20
"Hey brother Christian with your high and mighty errand, Your actions speak
so loud, I can't hear a word you're saying."

-Greg Graffin (Bad Religion)

Jade Tucker

8/19/2008 4:17:00 PM

0

Glen Holcomb wrote:
> On Tue, Aug 19, 2008 at 4:28 AM, Peña, Botp <botp@delmonte-phil.com>
> wrote:
>
>> c. checking email fxnality by sending an email. for a sample, see my last
>> post here
>> http://groups.google.com/group/ruby-talk-google/browse_thread/thread/957dc5...
>>
>> kind regards -botp
>>
>>
>>
>>
>>
>>
> Small qualifier here. Outlook doesn't always do SMTP, it can be turned
> off
> by the more Evangelical MS Admins.
>
> --
> "Hey brother Christian with your high and mighty errand, Your actions
> speak
> so loud, I can't hear a word you're saying."
>
> -Greg Graffin (Bad Religion)

Thanks for the tips. But yeah, I can't test with SMTP and I already
have another app to do ping tests on all of our servers.

UPDATE-- I got the app to work. I had to end up using Outlook 2003 on
the server. I had to use a plugin (forgot the name but i can get it) to
modify the security settings in '03 so that it doesn't keep asking me to
allow the message to be sent. Part of my problem was that the Outlook
app wanted my password everytime it tried to send an email. I just
checked the box to remember the password.

Also, to anyone programming something that sends an email with outlook
03, you have to use the SyncObjects method after using message.Send or
else it will just put it in your outbox and not send the message. It
doesn't seem to do this in '07. Also, 07 provides the ole method
SendAndRecieve.

Here is a little code to clarify:

require 'win32ole'

@outlook = WIN32OLE.new('Outlook.Application')
@mapi = @outlook.GetNameSpace('MAPI')

message = @outlook.createItem(0)
message.subject('some subject')
...
message.Save
message.Send

@mapi.SyncObjects #OR with '07 @mapi.SendAndRecieve


--
Posted via http://www.ruby-....

Matt

6/22/2014 9:14:00 PM

0

AlleyCat <alleyccat@aohell.com> wrote in
news:MPG.2e11022fe87ccf9598ae9f@news.eternal-september.org:

>
> On Sun, 22 Jun 2014 11:14:05 -0400, Chaos in a Nutshell says...
>
>> He does seem detached from reality.... And he certainly is a liar
>> and a sociopath.
>
> HE doesn't run things... THAT'S why he's so out of touch.
>
> I have NO doubts that Obama isn't the one "pulling the strings" in
> this corrupt and criminal regime... he is the epitome of a Manchurian
> Candidate, plucked from obscurity, propped up with bogus facts about
> his education and how he lived his life prior to entering politics.
>

Wow, Clay. You really need to get back on those meds.

Soon, please.

Matt

AlleyCat

6/22/2014 9:32:00 PM

0


On Sun, 22 Jun 2014 21:13:56 +0000 (UTC), Matt says...

> Wow, Clay. You really need to get back on those meds.

For telling the truth?

If you want to keep on thinking I'm this "clay" person... go ahead... but
remember...

Insanity is repeating the same mistakes and expecting different results.

On Sat, 14 Jun 2014 16:02:36 -0400, Gearld Davis
<alleycatg@nospam.net>Jim Blake
@174.118.15.211 in Canada NNTP-Posting-Host:
1ANBsN11LoFlYGmVfBzkEw.user.speranza.aioe.org changed nyms, forging
another post yet again and lied like a Canadian whore in Message-ID:
<lni9qs$ftu$1@speranza.aioe.org>


I don't use aioe, and I'm not from Canada, stupid.

AlleyCat alley@aohell.com
1ANBsN11LoFlYGmVfBzkEw.user.speranza.aioe.org
Ray Keller aykeller@rnsmte.com
1ANBsN11LoFlYGmVfBzkEw.user.speranza.aioe.org
Cicero_Venatio nosurrender@never.net
1ANBsN11LoFlYGmVfBzkEw.user.speranza.aioe.org
Clay Northwood claynorthwood@gmail.com
1ANBsN11LoFlYGmVfBzkEw.user.speranza.aioe.org
claynorthwood clay@nobody.com

YOU are an idiot. Just because my nym is first on a list of nyms that a
nym-shifter is using, doesn't make me that nym-shifter. Maybe it is YOU
that needs to be on meds.

I am AlleyCat. I've only BEEN AlleyCat and my real name, for the past 21
years. I used "Benedryl", for about 1 day.

Repost:

Sorry, nerd. I don't nym-shift. I've used EXACTLY two nicknames in the
past 21 or so years... AlleyCat and Benedryl, only to have a little fun
with BeeSting Allergy.

I have NO reason to use another. I do not CARE that I may have been
killfiled. If you dorks want to be the cowards that you are and killfile
people based on the FACT that someone gets under your skin because they
tell the truth and don't spin everything around to try and make Obama look
better than he really does... have at it. Cowardly is what coward does.

If you have proof that I nym-shift, by all means, show me. You WON'T
because I don't nym-shift... OK, nerd? alt.dev.null LOLOLOLOLOL

--

A "teabagger" is a male Democrat who performs fellatio on another male
Democrat... either sucking his balls or laying his genitals on his
partner's face. <snicker>

Matt

6/22/2014 10:09:00 PM

0

AlleyCat <alleyccat@aohell.com> wrote in
news:MPG.2e11074f9435139098aea2@news.eternal-september.org:

>
> On Sun, 22 Jun 2014 21:13:56 +0000 (UTC), Matt says...
>
>> Wow, Clay. You really need to get back on those meds.
>
> For telling the truth?

For being insane.

Matt

AlleyCat

6/22/2014 11:59:00 PM

0


On Sun, 22 Jun 2014 15:16:50 -0700 (PDT), vithant@gmail.com says...

> Bush was and empty suit, fronting for Cheney and the others.

I agree... but that doesn't mean that Obama "runs" a fucking thing, except
his big mouth. His strings are being pulled, EXACTLY a Bush's were.

Do you REALLY buy that shit about Obama "learning" everything from the TV
news? What does he watch, Fox? BWAHAHAHA

They're the only ones reporting the criminal activity of "his" regime,
right? So, he MUST be watching Fox.

--

A "teabagger" is a male Democrat who performs fellatio on another male
Democrat... either sucking his balls or laying his genitals on his
partner's face. <snicker>

AlleyCat

6/23/2014 12:03:00 AM

0


On Sun, 22 Jun 2014 22:08:48 +0000 (UTC), Matt says...

> For being insane.

Are "insane" people allowed to own businesses? Houses? What do you OWN?
What kind of business do YOU have? Being the maid of mommy's basement
doesn't count, nerd.

Alas, poor Mattsiepoo. Can't stand to hear the truth about your Messiah,
so the personal attacks come. Sad.

Why don't you discuss a topic, instead of just saying someone's insane for
saying it? Prove me wrong, homo.

--

A "teabagger" is a male Democrat who performs fellatio on another male
Democrat... either sucking his balls or laying his genitals on his
partner's face. <snicker>

Yoorghis

6/23/2014 3:48:00 AM

0

On Sun, 22 Jun 2014 19:02:54 -0500, AlleyCat <alleyccat@aohell.com>
wrote:

>
>On Sun, 22 Jun 2014 22:08:48 +0000 (UTC), Matt says...
>
>> For being insane.
>
>Are "insane" people allowed to own businesses?

Yes.

All you have to do is have daddy will you $26 Billion each like he did
the Koch Brothers---and you can pump your insanity all over without
ever running out of money