Sendmail Example Usage for Bash

Useful snippet I wrote up after searching the internet for details on syntax for sendmail in Linux.

PRETTY_HOSTNAME=$(hostnamectl --pretty)

sendmail -F "" -it <<END_MESSAGE
Content-Type: text/html
MIME-Version: 1.0
Subject: [INFO] Connection Details
Hostname: $PRETTY_HOSTNAME <br />
If your program is down, do the following.
<br />
1. Open Putty <br />
2. Establish Connection to $PRETTY_HOSTNAME <br />
2a. Username: $ADMIN_USERNAME <br />
2b. Password: $ADMIN_PASSWORD <br />
3a. Check for the status of your program. <br />
If there are any questions or concerns please reach out to your server admin.
<br />
Thanks, <br />
Automated System 

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s