Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-31-2014, 02:25 AM   #1
byran cheung
Registered: Sep 2013
Posts: 321

Rep: Reputation: Disabled
Add mail content

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

#mail -a attach.txt

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

Last edited by byran cheung; 03-31-2014 at 02:32 AM.
Old 03-31-2014, 02:43 AM   #2
Senior Member
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,733

Rep: Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Add one file's content into another remotely unclesamcrazy Linux - Newbie 12 06-17-2013 03:56 AM
add content to .config file wahaha Linux - Wireless Networking 1 08-27-2006 10:14 AM
Add file content to a variable (bash)? LinuxSeeker Programming 4 12-19-2005 01:41 PM
how to add content to KDE help center of SuSE Linux zhaosj SUSE / openSUSE 1 11-14-2005 02:43 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:29 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration