[NTLUG:Discuss] Command Line Email
Christopher Cox
cjcox at acm.org
Wed Dec 18 22:54:53 CST 2013
On 12/18/2013 12:26 PM, George Lass wrote:
> I am having some difficulties using mail(1) to send emails and
> am hoping someone here can help me out. In particular, I need a have
> a Reply-To: address that is different than the From: address. The man page
> for mail says that the "-R address" option will do this, but it doesn't seem to
> work for me.
>
> echo "This is a test" | mail -s "Some Interesting Subject" -R someone at Reply.net someone at Destination.net
>
> Will send a copy of the email to both someone at Reply.net and
> someone at Destination.net. It also does not change the Reply_To address
> in the sent mail. Reversing the order of -s and -R causes mail to ignore
> "Some Interesting Subject" which results in an interactive prompt for
> the message subject. I suspect it would also send the mail both places...
>
> Does anyone know of a way to make this work?
Well, my version of mail/mailx uses -r (lowercase r)... but regardless...
Spoofing mail is never a good idea.
Maybe this example will help you out? The "-t" to mail/mailx will allow me to
specify fields much like you would with sendmail or other lower level tool.
The blank line is important after subject and the "." terminates and sends the
message.
mail -t
To: "Chris Cox" <ccox at somedomain.com>
From: "Bill Gates" <bgates at microsoft.com>
Reply-to: "Bill Clinton" <bclinton at wh.gov>
Subject: Test 6
Testing
.
More information about the Discuss
mailing list