#54713 - 2001-03-25 10:36 PM
Send email via exchange from script?
|
Anonymous
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
|
|
|
|
#54715 - 2001-03-26 02:33 AM
Re: Send email via exchange from script?
|
Anonymous
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
|
|
|
|
#54717 - 2001-03-26 11:46 AM
Re: Send email via exchange from script?
|
Anonymous
Anonymous
Unregistered
|
I have found an loginscript that reports error to an administrator in case something goes wrong. That script uses postie.exeYou 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
Anonymous
Unregistered
|
Blat: v1.8.2bRegistry: 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
|
|
|
|
#54720 - 2001-03-27 02:51 AM
Re: Send email via exchange from script?
|
Anonymous
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
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
   
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)
|
|
Top
|
|
|
|
#54724 - 2002-04-05 01:16 AM
Re: Send email via exchange from script?
|
Anonymous
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
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 ]
|
|
Top
|
|
|
|
#54726 - 2002-04-05 01:36 PM
Re: Send email via exchange from script?
|
Dean R
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
   
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
|
|
Top
|
|
|
|
#54731 - 2002-04-05 09:53 PM
Re: Send email via exchange from script?
|
Anonymous
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
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.
cj
p.s. Yesterday was my 2nd birthday on this board
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 878 anonymous users online.
|
|
|