MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

Linux Tutorials: Commands to send an email in Linux

rajeshkumar created the topic: Various Commands to send an email in Linux
Sending mail
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 rajeshk@adobe.com < raj.txt

mailx rajesh@xyz.com < /tmp/db_reorg.log
echo "This is test Subject" | mailx rajesh@xyz.com
mailx -s "This is test Subject" rajesh@xyz.com < test.txt
echo "This is test Subject" | mailx -c love@xyz.com -s "Join us watching Star Wars" rajesh@xyz.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" rajesh@xyz.com

Email photo.png along with a text message read from body.txt
cat body.txt; uuencode photo.png photo.png) | mail -s "Subject" rajesh@xyz.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 rajesh@xyz.com < /tmp/body.txt

Unix command to send an email attachment
or
mailx command to send an email with attachment

Code:
uuencode file1 file2 | mail user@companyname.co.in -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….

Install uuencode
======================================
yum install shareutils
or
wget ftp.scientificlinux.org/linux/scientific/6.2/x86_64/os/Packages/sharutils-4.7-6.1.el6.x86_64.rpm
rpm -ivh sharutils-4.7-6.1.el6.x86_64.rpm
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

PHP Code for Godaddy VPS Server SMTP Email Relay

This page shows how to send email from a GoDaddy VPS through GoDaddy's SMTP relay on port 25 with plain PHP sockets and no extra libraries. Below…

Read More

Email Authentication & Communication Infrastructure in Modern DevOps: The 2026 Definitive Guide

In the high-stakes world of modern DevOps, we spend our days (and sometimes our nights) obsessing over the “golden signals” of site reliability: latency, traffic, errors, and…

Read More

The 5 Most Popular Email APIs Among Developers In 2026

In the modern world, where everything is going digital, email is among the most important means of communication both in personal and business life. As a developer,…

Read More

Senior Exchange Administrator: Role Blueprint, Responsibilities, Skills, KPIs, and Career Path

The Senior Exchange Administrator is accountable for the reliability, security, performance, and lifecycle management of the organization’s Microsoft messaging platform, typically spanning Exchange Online (Microsoft 365), Exchange Server (on-premises), or a hybrid configuration. This role ensures email and calendaring services are highly available, compliant, and aligned to business needs while proactively reducing operational risk and improving user experience.

Read More

Principal Exchange Administrator: Role Blueprint, Responsibilities, Skills, KPIs, and Career Path

The Principal Exchange Administrator is the senior technical authority responsible for the reliability, security, lifecycle, and operational excellence of the enterprise messaging platform—typically Microsoft Exchange Online/Exchange Server in a hybrid Microsoft 365 environment. This role exists to ensure email and calendaring services remain highly available, performant, compliant, and aligned with enterprise security and governance requirements while enabling modern collaboration capabilities across the organization.

Read More

Lead Exchange Administrator: Role Blueprint, Responsibilities, Skills, KPIs, and Career Path

The Lead Exchange Administrator owns the reliability, security, and operational excellence of the organization’s messaging platform, typically Microsoft Exchange Online (Microsoft 365) and/or a hybrid Exchange deployment with on‑premises Exchange servers. This role ensures email and calendaring services remain highly available, performant, compliant, and resilient, while continuously improving automation, monitoring, and service management maturity.

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x