There’s many times when I want to send an email for testing using postfix and I can never remember how to do it. Here is how.This is super useful to make sure your SMTP relay thru AWS/Postmark is working as it should. Then you can tail /var/log/mail.log to see if it worked or if it got rejected for whatever reason.

First type the following to start sendmail

sendmail [email protected]

Now we can type in or paste the following

To: [email protected]
From: [email protected]
Subject: Test Send Mail
Hello World

To end the input and start the send hit ctrl+D