[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trivial SMTP client



On Fri, 29 Mar 2002, David S. wrote:

> (Re-inventing the wheel) You could do the 'telnet' trick with 'expect'.
> But 'telnet' + 'expect' + 'tcl' + ... would not be a "small" SMTP client.

You could also use nc(1). As long as you generate the right text,
it should work. Something like:

helo hostname.example.com
mail from: foo@example.com
rcpt to: bar@example.com
data
blahblahblah
.

in a file mailtest, then `nc mailserver 25 < mailtest`. Note that this is
*not* robust at all. But, if you're going to be generating the messages,
I think nc should be sufficient.
+------------------------------------------------------------------------+
| Dave Taira <bodhi@hagakure.org>                2002.03.29/20:16:24 PST |
| Morlock for Hire                                                       |
+------------------------------------------------------------------------+
| Madness takes its toll.  Please have exact change.                     |
+------------------------------------------------------------------------+