swaks – Command line SMTP Testing Tool

swaks is a command line SMTP testing tool available at

http://www.jetmore.org/john/code/swaks/

On Debian/Ubuntu, you can install it with the command

Advertisement

apt install swaks
swaks mail testing tool

if you just type swaks, it will ask for your email, then send a mail using MX Record to a specified email address.

To send email using a specific mail server

swaks --to user@example.com --server test-server.example.net

Deliver a standard test email, requiring CRAM-MD5 authentication as user me@example.com. An “X-Test” header will be added to the email body. The authentication password will be prompted for if it cannot be obtained from your .netrc file.

swaks --to user@example.com --from me@example.com --auth CRAM-MD5 --auth-user me@example.com --header-X-Test "test email"

Here is an example command that uses a remote SMTP server to send email. I used this on a backup bash script to send email alters after the backup was completed.

swaks --to serverok.in@gmail.com --from labs@serverok.in --server smtp1.serverok.in --auth-user labs@serverok.in --auth-password '7XwlzPnSmlsWsdbS' --body "This is a test message" --header 'Subject: Backup completed'
Add a comment

Leave a Reply

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

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement