Page 1 of 2 12>
Topic Options
#54713 - 2001-03-25 10:36 PM Send email via exchange from script?
Anonymous
Unregistered


How would I go about getting kixtart to send an email using exchange server?

The user's outlook profile will have already been created by the time this script runs so that won't need doing.

I'm sure this must be possible. I've tried using BLAT but had very poor results with it.
Most of the time it seems to just quit without doing anything, even if I set the registry by hand because it's done it wrong.

TVM if you can help!

Alex

Top
#54714 - 2001-03-26 01:01 AM Re: Send email via exchange from script?
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
Blat needs an SMTP server,not exchange.

I believe there are a ew SMTP servers out on the Internet that accept anonymous emails, so long as your 'from' domain is registered.

cj

------------------
For more scripts goto my website and click the hammer and spanner icon.

chrismat@ozemail.com.au

Top
#54715 - 2001-03-26 02:33 AM Re: Send email via exchange from script?
Anonymous
Unregistered


Our exchange servers run SMTP anyway, but even using a fast dedicated SMTP server that will accept mail for us it does not work. Basically IMHO BLAT is crap. I'm starting to wonder how difficult it would be to graft some PERL on & use that...

Alex

Top
#54716 - 2001-03-26 05:29 AM Re: Send email via exchange from script?
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
Can you post your BLAT registry setting and command line commands...

What version of Blat are you using?

I have been using it for a few years now and it has never failed.

cj

Top
#54717 - 2001-03-26 11:46 AM Re: Send email via exchange from script?
Anonymous
Unregistered


I have found an loginscript that reports error to an administrator in case something goes wrong.
That script uses postie.exe

You can find it here : http://www.infradig.com/infradig/index.shtml

I hope this is what you are looking for

regards
broekkie

Top
#54718 - 2001-03-27 12:31 AM Re: Send email via exchange from script?
Anonymous
Unregistered


Blat: v1.8.2b

Registry:
REGEDIT4


Code:
$RC = AddKey ("HKEY_LOCAL_MACHINE\SOFTWARE\Public Domain")
$RC = AddKey ("HKEY_LOCAL_MACHINE\SOFTWARE\Public Domain\Blat")
$RC = WriteValue ("HKEY_LOCAL_MACHINE\SOFTWARE\Public Domain\Blat", "SMTP server", "$SMTPServer", "REG_SZ")
$RC = WriteValue ("HKEY_LOCAL_MACHINE\SOFTWARE\Public Domain\Blat", "Sender", "helpdesk@@uk.bsmg.com", "REG_SZ")
$RC = WriteValue ("HKEY_LOCAL_MACHINE\SOFTWARE\Public Domain\Blat", "SMTP Port", "25", "REG_SZ")
$RC = WriteValue ("HKEY_LOCAL_MACHINE\SOFTWARE\Public Domain\Blat", "Try", "3", "REG_SZ")
$RC = MessageBox ("Norton AntiVirus may have a fault on this machine." + chr(10) + "Please call your local IT helpdesk and ask them to check", "Defwatch.exe missing!", 48, 300)
Shell "blat NAV_Fault.txt -t $AlertAddress -q -s NAV_fault_on_@WKSTA_during_logon_by_@USERID" ; email the helpdesk to report the find

Thanks for any advice - I'm going to look at postie and see if that's any better.


Alex

Top
#54719 - 2001-03-27 02:30 AM Re: Send email via exchange from script?
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
I tested your script and so long as $AlertAddress has @@, it works fine.

Are you getting any errors?

cj

Top
#54720 - 2001-03-27 02:51 AM Re: Send email via exchange from script?
Anonymous
Unregistered


Hi CJ,

No errors, but I'm not getting any mail either... :-(


Alex

Top
#54721 - 2001-04-06 08:10 PM Re: Send email via exchange from script?
Anonymous
Unregistered


Have found workable solution... use a better mail server (corporate relay instead of local exchange server) and write the registry keys for BLAT using kixtart instead of letting BLAT do it. Works MUCH better but still get the occasional error due to "file not found" when BLAT is told to email the contents of a text file. This works on 99% of machines, but the odd one or do it doesn't - any ideas what I should look for? Machines are all Winnt4.

Cheers!

Alex

Top
#54722 - 2001-04-06 09:06 PM Re: Send email via exchange from script?
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
here is a script using OLE (it will not work on 2000 SR2) (outlook security patch)

code:

$recipient= "@userid" ; use double @@'s for internet addresses
$subject = "This is the subject"
$message = "This is the message body"

$outlook = olecreateobject("outlook.application")
$namespace= val("&"+olecallfunc($outlook,"getnamespace","s","MAPI"))
$= olecallfunc($namespace,"logon")
$mailitem = val("&"+olecallfunc($outlook,"createitem","s","0"))
$recipients= val("&"+olegetproperty($mailitem,"recipients"))
$= olecallfunc($recipients,"add","s","$recipient")
$= oleputproperty($mailitem,"subject","s","$subject")
$= oleputproperty($mailitem,"body","s","$message")
$= olecallfunc($mailitem,"send")
$= olecallfunc($namespace,"logoff")
$= olereleaseobject($recipients)
$= olereleaseobject($mailitem)
$= olereleaseobject($outlook)


_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#54723 - 2001-04-09 09:19 AM Re: Send email via exchange from script?
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Is there any chance that a workstation might have a reserved character or space in the name? as you include "@WKSTA" in the subject and it is not quoted it could cause you problems.
Top
#54724 - 2002-04-05 01:16 AM Re: Send email via exchange from script?
Anonymous
Unregistered


Radimus, is there anyway to send this to multiple people at once???
Top
#54725 - 2002-04-05 03:28 AM Re: Send email via exchange from script?
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Kellar,

Just add in other addresses with a semicolon:

$recipient= "@userid"

Like this..

$recipient= "user@@domain1.com; user2@@domain2.com"

HTH,

- Kent

[ 05 April 2002, 03:29: Message edited by: kdyer ]
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#54726 - 2002-04-05 01:36 PM Re: Send email via exchange from script?
Dean R Offline
Starting to like KiXtart

Registered: 2002-03-15
Posts: 115
Loc: Ireland, but Im an Aussie
I personally use postie.exe, never heard of Blat, has anyone used both? if so which do you think is more reliable.
_________________________
-------------------------------- When you can take this stone from my hand Gwasshoppa you are read... *yoink* Gwasshoppa? Gwasshoppa? Where did you go? ---------------------------------

Top
#54727 - 2002-04-05 02:32 PM Re: Send email via exchange from script?
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Dunno about postie.

I use Blat on all my servers to forward the results of the overnight backup and have never had a problem.

I use a Linux box as an SMTP gateway rather than Exchange, so maybe that's why I find it more reliable [Razz]

Top
#54728 - 2002-04-05 02:38 PM Re: Send email via exchange from script?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well...
if you use smtp server you will not need any of those programs.
we have had a udf for some time now which does it without any dependencies.
check it out at:
http://81.17.37.55/board/ultimatebb.php?ubb=get_topic;f=3;t=000161
_________________________
!

download KiXnet

Top
#54729 - 2002-04-05 02:41 PM Re: Send email via exchange from script?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
actually, kdyer, saw that you were then allready speaking about blat... [Razz]

good that it works for you
_________________________
!

download KiXnet

Top
#54730 - 2002-04-05 06:44 PM Re: Send email via exchange from script?
Breaker Offline
Hey THIS is FUN
*****

Registered: 2001-06-15
Posts: 268
Loc: Yorkshire, England
I've used Postie a few times without any difficulty - never tried Blat since Postie was working OK... [Big Grin]

My login scripts initialise $Message and $Subject as global variables, then set them and call this sendmail script as necessary.

code:
;Send mail script using Postie command line utility
$HOST = "-host:[SMTP server IP address] "
$PORT = "-port:25 "
$SENDFROM = "-from:some.user@@someplace.com "
$SENDTO = "-to:some.otheruser@@elsewhere.COM "
$SUBJECT = "-s:TEST "
$MESSAGE = "-msg:HELLO "
$COMMAND = "POSTIE.EXE "
$POSTIELINE = $COMMAND + $HOST + $PORT + $SENDFROM + $SENDTO + $SUBJECT + $MESSAGE
SHELL "cmd /c $POSTIELINE"

exit

Hope this helps. I have to say after some of my recent flirtations with COM, I'd prefer to try and develop a method of doing this without shelling out to other products - maybe next time I get a few minutes spare...fat chance!

Word of warning, though - be careful with your inverted commas!

[ 05 April 2002, 18:48: Message edited by: Breaker ]
_________________________
================================================
Breaker


Top
#54731 - 2002-04-05 09:53 PM Re: Send email via exchange from script?
Anonymous
Unregistered


Dear aheylin,

Did you say Perl ? Here is a very easy to use (no perl knowledge required) Perl script I wrote that will send email with:
unlimited receipients
unlimited attachments
compressed attachments (separate zip files)
compressed attachments (one "big" zip file)
3 predefined html styles for your text
no other email software is needed.

ps1. You must have Perl installed (it is not compiled to exe)
ps2. If you want the compressed attachments you
must give the command "ppm install Archive-Zip"
to install the zip perl module.
Tested only at win2k.

http://www.geocities.com/gravitalsun/scripts/email.zip

(right, click save as ...)

Top
#54732 - 2002-04-07 02:34 AM Re: Send email via exchange from script?
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
I have used Blat, Postie and MailTo for sending emails from the command line and 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.

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.

Following the links on this thread takes you to a page I posted with a .DLL (COM object) that lets you send email too. There are many ways to skin a cat, as they say.

[Smile]

cj

p.s. Yesterday was my 2nd birthday on this board [Big Grin]

Top
Page 1 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.037 seconds in which 0.013 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