LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 03-31-2014, 02:25 AM   #1
byran cheung
Member
 
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 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

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

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
This:

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


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:17 PM.

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