[NTLUG:Discuss] Command Line Email
George Lass
george.lass at sbcglobal.net
Thu Dec 19 11:16:02 CST 2013
From: Christopher Cox <cjcox at acm.org>
To: discuss at ntlug.org
Sent: Wednesday, December 18, 2013 10:54 PM
Subject: Re: [NTLUG:Discuss] Command Line Email
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
.
_______________________________________________
http://www.ntlug.org/mailman/listinfo/discuss
---------------------------------------------------------------
Thanks for all of the suggestions. I finally wound up using
cat mailFile.txt | sendmail -t
which allows everything to be specified in mailFile:
From:
To:
Reply-To:
Subject:
.
.
.
Also wanted to let you know that the reason for needing different
From and Reply-To addresses is that our Yahoo Biz Mail account
only allows a single sender and the project I'm working on requires
that I send email on behalf of multiple users.
Thanks Again,
George
More information about the Discuss
mailing list