Bobcares

msmtp send email example | Guide

by | May 12, 2022

msmtp send email example by our experts will put you on the right track to using msmtp.

At Bobcares, we offer solutions for every query, big and small, as a part of our Server Management Services.

Let’s take a look at how our Support Team is ready to help customers with an msmtp send email example.

About msmtp Send Email Example

Today, our Support experts are going to take us through configuring how to send emails from the terminal via msmtp.

Before we begin, we have to install and configure msmtp.

msmtp send email example

After the installation and configuration process, we can use libsecret tool to store our password in the system keyring. This is done via the Secret Service API. In other words, our desktop environment implements the Secret Service specification (either GNOME or KDE).

We have to run the following command to ensure the libsecret tools are installed:

sudo apt install libsecret-tools

Then, we can store the password in the system keyring with the following command:

secret-tool store --label msmtp \
    host smtp.gmail.com \
    service smtp \
    user YOUR_LOGIN

Alternatively, we can use a GUI like seahorse to do the same job.

After saving the password, we can send an email without requiring a password again.

We can also send emails from the command line with git. In this scenario, we can override the default with:

-smtp-server=

This will work by adding a snippet like the one below to the ~/.gitconfig file:

[sendemail]
    smtpserver = /usr/bin/msmtp

Some other command-line tools that help us send emails include bts and reportbug.

In other words, we can send emails with msmtp rather than sendmail with:

bts --sendmail='/usr/bin/msmtp -t'

[Need assistance with another query? We are available 24/7.]

Conclusion

In a nutshell, our skilled Support Engineers at Bobcares demonstrated an msmtp send email example.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.