LinuxQuestions.org
Help answer threads with 0 replies.
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, 03: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 03:32 AM.
 
Old 03-31-2014, 03:43 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,305

Rep: Reputation: 816Reputation: 816Reputation: 816Reputation: 816Reputation: 816Reputation: 816Reputation: 816
This:

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


Reply


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 04:56 AM
add content to .config file wahaha Linux - Wireless Networking 1 08-27-2006 11:14 AM
Add file content to a variable (bash)? LinuxSeeker Programming 4 12-19-2005 02:41 PM
how to add content to KDE help center of SuSE Linux zhaosj SUSE / openSUSE 1 11-14-2005 03:43 AM


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

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration