Erik Schoenfelder wrote [edited]:
> On Tue, 18 Aug 1998 09:33:42 -9,
> "Bob Jaques" <jaques@imsn.net> said:
> Bob> I am moving from unix to nt with scotty. I use a modified
> Bob> monitor.tcl that emails events to me. How do i do this in nt
> Bob> ???
>
> The best idea coming into my mind, is to use an existing smtp service
> on your network. Opening a tcp-channel to port 25 of a known
> smtp-host, and speaking the necessary smtp dialog (HELO, MAIL FROM,
> RCPT TO, DATA, QUIT).
The quick-and-dirty solution (probably snatched off the net sometime):
proc send_mail {mailserver from to data} {
set s [socket $mailserver 25]
gets $s answer
if {[lindex $answer 0] != 220} {error $answer}
puts $s "MAIL FROM:<$from>"
flush $s
gets $s answer
if {[lindex $answer 0] != 250} {error $answer}
puts $s "RCPT TO:<$to>"
flush $s
gets $s answer
if {[lindex $answer 0] != 250} {error $answer}
puts $s DATA
flush $s
gets $s answer
if {[lindex $answer 0] != 354} {error $answer}
puts $s $data
flush $s
puts $s .
flush $s
gets $s answer
if {[lindex $answer 0] != 250} {error $answer}
close $s
}
A more complete solution is included in Andreas Kupries' Pool collection:
http://www.westend.com/%7Ekupries/doc/pool/index.htm
- -- zvr --
+---------------------------+ Alexios Zavras (-zvr-)
| H eytyxia den exei enoxes | zvr@aueb.gr
+-----------------------zvr-+
-- !! This message is brought to you via the `tkined & scotty' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>. !! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.