HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

msmtp — An SMTP client. It reads text from `stdin` and sends it to an SMTP server. More information: <https:

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandclienttextfromreadsmsmtpclismtp

Problem

How to use the msmtp command: An SMTP client. It reads text from stdin and sends it to an SMTP server. More information: <https://marlam.de/msmtp/>.

Solution

msmtp — An SMTP client. It reads text from stdin and sends it to an SMTP server. More information: <https://marlam.de/msmtp/>.

Send an email using the default account configured in ~/.msmtprc:
echo "{{Hello world}}" | msmtp {{to@example.org}}


Send an email using a specific account configured in ~/.msmtprc:
echo "{{Hello world}}" | msmtp --account={{account_name}} {{to@example.org}}


Send an email without a configured account. The password should be specified in the ~/.msmtprc file:
echo "{{Hello world}}" | msmtp --host={{localhost}} --port={{999}} --from={{from@example.org}} {{to@example.org}}

Code Snippets

Send an email using the default account configured in `~/.msmtprc`

echo "{{Hello world}}" | msmtp {{to@example.org}}

Send an email using a specific account configured in `~/.msmtprc`

echo "{{Hello world}}" | msmtp --account={{account_name}} {{to@example.org}}

Send an email without a configured account. The password should be specified in the `~/.msmtprc` file

echo "{{Hello world}}" | msmtp --host={{localhost}} --port={{999}} --from={{from@example.org}} {{to@example.org}}

Context

tldr-pages: common/msmtp

Revisions (0)

No revisions yet.