LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Add mail content (https://www.linuxquestions.org/questions/linux-newbie-8/add-mail-content-4175500006/)

byran cheung 03-31-2014 02:25 AM

Add mail content
 
I use the below command to send mail to user with the attachment file .

#mail -a attach.txt email@domain.com

Would advise if I want to add mail content to the mail , when the user read the mail , the mail content shows today's date ( assume today is Apr 1 , 2014 ) as below , would advise how to change the mail command to do that ? thanks

mail content
=============
Dear all,
Today is Apr 1 , 2014

TenTenths 03-31-2014 02:43 AM

This:

Code:

echo -e "Dear all,\nToday is $(date +%B\ %e,\ %Y)" | mail -a attach.txt email@domain.com


All times are GMT -5. The time now is 11:09 PM.