rajeshkumar created the topic: Various Commands to send an email in Linux
To send a message to one or more people, mailx can be invoked with arguments which are the names of people to whom the mail will be sent. The user is then expected to type in his message, followed by an ‘control-D’ at the beginning of a line.
mails -s "this is test" -a SG_COMM.sql.gz firstname.lastname@example.org < raj.txt
mailx email@example.com < /tmp/db_reorg.log
echo "This is test Subject" | mailx firstname.lastname@example.org
mailx -s "This is test Subject" email@example.com < test.txt
echo "This is test Subject" | mailx -c firstname.lastname@example.org -s "Join us watching Star Wars" email@example.com
Send an email in Linux with attachment
Attach /tmp/list.tar.gz and and send it
uuencode /tmp/list.tar.gz /tmp/list.tar.gz | mailx -s "Subject" firstname.lastname@example.org
Email photo.png along with a text message read from body.txt
cat body.txt; uuencode photo.png photo.png) | mail -s "Subject" email@example.com
Attach /tmp/filelist.tar.gz and read the content of a text using /tmp/body.txt
mutt -s “Backup status” -a /tmp/filelist.tar.gz firstname.lastname@example.org < /tmp/body.txt
Unix command to send an email attachment
mailx command to send an email with attachment
uuencode file1 file2 | mail email@example.com -s "subject"
uuencode is a utility which is to be found with sharutils. make sure its installed. To check wheterh its installed or not.
which uuencode or
locate uuencode or
rpm -qa | grep sharutils
If you do not found, then you might have to install it. You need to install sharutils by folliwing commands….
yum install shareutils
rpm -ivh sharutils-4.7-6.1.el6.x86_64.rpm
Twitt me @ twitter.com/RajeshKumarIn
- Dynatrace’s USQL (User Session Query Language) Tutorial - September 30, 2023
- List of Top & Free Digital Marketing Software in the world - September 30, 2023
- Top Digital Marketing Websites - September 30, 2023