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

Re: Setting Reply-To && From fields dynamically



> This is on a Linux machine and mail is sent using mailx's mail program.
> The MTA is sendmail (which I know little about).
> 
> If there's anything as simple as setting an appropriate environment
> variable, that'd be just cool. The mail sending is done inside a
> (bourne) shell script.

You could call sendmail itself from the shell script.  i.e.

#!/bin/bash

TO=me@myaddress.com
FROM=you@youraddress.com

/usr/sbin/sendmail -t <<EOF
To: $TO
From: $FROM
Subject: Whatever

The message


EOF

This way, you could dynamically set TO and FROM variables to whatevery you
want.

Anthony



Reply to: