Use mail command in linux
Once ssmtp installed successfully, you need to make the below global configurations which required for sending mail.
#Use mail command in linux install#
In CentOS, you may see an error during installation as "package ssmtp is not available", in such a case below command, is going to be helpful to fix the issue: sudo yum -enablerepo=extras install epel-release Use the below command to install ssmtp: sudo apt-get install ssmtpĬentOS users can use the below command to install ssmtp: sudo yum install ssmtp How to install sSMTP to send mails from your Linux command line (CLI) Step 1
#Use mail command in linux how to#
Click here, in case you want to learn how to install and use Mailx to send mails from your Linux command line. In this tutorial, you're going to learn the steps on how to install and use sSMTP to send mails from your Linux command line. There are various tools and libraries which you can install to send emails from the terminal. Google SMTP server configurations would look something like this: In this tutorial, you are going to use Gmail SMTP to send emails, so make sure that Configure Gmail SMTP/ready with any other custom SMTP server details.SMTP Configurations (SMTP server details and authentication credentials).With simple libraries and little configurations, you can have a CLI tool in your Linux OS that you can use to send mails from the terminal. There are many ways to send emails from the server, but let's explore the tool that's easy to install and easy to code. This tutorial is going to help you in sending critical server-level emails like Cron reports, script logs, customer registrations, receipt, bank statement over email. You are going to learn the process of sending emails from the terminal or a shell script from a Linux operating system, using some of the popular CLI tools. This tutorial is going to demonstrate you the simplest way of sending notifications, over one of the most popular channels that is email. Moreover, these notifications can be emails, SMS or push. Notifications are getting more important these days to stay updated among various online activities. The author voluntarily contributed this tutorial as a part of Pepipost Write to Contribute program.