Page 2 of 2 <12
Topic Options
#54733 - 2002-04-09 02:27 AM Re: Send email via exchange from script?
Netsuper Offline
Getting the hang of it

Registered: 2001-05-17
Posts: 64
Loc: Edwards AFB, CA, US
Here's a COM example:

$recipients_to = "somebody@@domain.com"
$recipients_cc = "somebodyelse@@domain.com"
$emailbody = "the email body goes here"
$emailattach = "C:\TEST\TEST.zip" ; email attachment goes here

$Root = CreateObject("Outlook.Application")
$MailItem = $Root.CreateItem(0) ; olMailItem object
$MailItem.Importance=2
$MailItem.Subject = "Subject goes here"
$MailItem.To = $recipients_to
$MailItem.CC = $recipients_cc
$MailItem.Body = $emailbody
$MailItem.Attachments.Add($emailattach)
$MailItem.Send
_________________________
Scott Hickerson Network Design Engineer

Top
#54734 - 2002-04-11 07:54 AM Re: Send email via exchange from script?
gwgaston Offline
Fresh Scripter

Registered: 2002-02-06
Posts: 13
quote:
...the advantages/disadvantages I have noticed are that Blat requires the body of the email to be in a text file where as Postie/Mailto will accept it on the command line.
Use Blat's -body switch... see on down.

quote:
Upside to that is the same, with the text file for Blat you can have multiple lines, can't do that on the command line.
You do multiple lines of text on the command line with Blat like this (assuming you have working profile info for server, from address, etc.):

blat - -to someone@somewhere.com -s YAT -body "First line.|Second Line.||Fourth Line." -noh2

HTH,
Gerald W. Gaston

Top
#54735 - 2002-04-11 08:49 AM Re: Send email via exchange from script?
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Happy late birthday CJ

Don't catch up to me too quick now [Eek!]

Top
#54736 - 2002-04-20 02:35 PM Re: Send email via exchange from script?
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
gwgaston, thanks! I have been using Blat forever and never even noticed the new options. [Roll Eyes]

ntdoc, you are ahead of me on posts, I shall have to kick your azz [Big Grin]

cj

Top
#54737 - 2002-04-20 04:20 PM Re: Send email via exchange from script?
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
We use postie almost exclusively throughout the enterprise. No registry tweaking to use it. Just a simple SMTP Mailer.

Hey ceej - We are "neck and neck" with posts!

- Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#54738 - 2002-05-10 03:00 AM Re: Send email via exchange from script?
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
lol, yes - but now I am 1 more [Razz]

cj

Top
Page 2 of 2 <12


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 611 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.057 seconds in which 0.024 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org