On Mon, 2005-05-02 at 10:35 +0200, Patrick Marquetecken wrote:
> I'm looking for a smtp mail-client that can send emails from a script,
> from different from addresses and can use text files as body text, at this
> time i just looked at pine, but i don't thik thats possible.

If the scripts go on a machine with a full email server on there
(sendmail, exim, courier, qmail, etc.) no matter which one it is they
usually include an executable called "sendmail" which is a common one
for scripts to use, often with a syntax like:
cat headerplusbody.txt | sendmail

If you don't have a real mailserver locally, you can emerge "ssmtp" and
in a config file tell it the address of your real mailserver, and it
will provide an equivalent "sendmail" binary on your machine that can be
called and it'll just hand it off to the real server.

Generally, I'll have my scripts echo "From: <blah>\nTo: <recipient>\n\n"
into a temporary file, then add whatever content the script produces
then cat it piped to sendmail. A lot of the header stuff is optional but
at least giving to/from/subject then a blank line to separate the
content, is good enough. Depending on your mailserver or the
recipient's, leaving those out can cause the mail to be rejected as
broken or a virus/spam. 

I'd gotten used to marginally different command-line syntax (on BSD)
that used the "mail" command, that is provided by "emerge mailx", I
think I liked it because it did headers for you, so just:
cat justthebody.txt | mail [EMAIL PROTECTED]


--
Scott Taylor - <[EMAIL PROTECTED]> 

BOFH Excuse #284:

Electrons on a bender

    

-- 
[email protected] mailing list

Reply via email to