🧀Use SWAKS for testing and troubleshooting

SWAKS is a vital tool to learn for testing and troubleshooting your ESP platform.

When you use SWAKS for troubleshooting, you're reducing variables and confounders that may be caused by the software you're introducing into your email ecosystem.

Install SWAKS using one of the methods on their installation page:

Test to see if you can connect to a port on your ESP platform using the DNS hostname:

swaks --server transactional.fivetacofiesta.com --port 587 -q connect

A successful connection will look something like the following:

If connecting using the DNS hostname fails, try the IP address of your VPS instead:

swaks --server 1.2.3.4 --port 587 -q connect

*** Note: You must use the real IP address of your Linux VPS above, not "1.2.3.4", it's a placeholder.

SWAKS syntax basics

Type swaks --help to see some example use cases and documentation.

--from sender@my.domain.com   
--to recipient@domain.com  
--server esp.domain.com    
--port 587                 
--auth LOGIN               
--auth-user API Key        
--auth-password API Key    
--header "Subject: hello from SWAKS"
--body "This is a SWAKS demo" 

Use the real email address you want to send this message from here:

--from sender@my.domain.com

Use the real email address you want to send this message to here:

--to recipient@domain.com  

Your ESP platform DNS or IP:

--server esp.domain.com 

Your ESP platform listens for STMP Relay on Ports 587, 2525, and 8025:

--port 587 

Tell your ESP platform to use a username and password for authentication:

--auth LOGIN 

Use your user API Key for your username:

--auth-user S8PHFSJyyc7GuYbJ2SHFVq

*** Note: You must use your real user account API Key above, not "S8PHFSJyyc7GuYbJ2SHFVq", it's a placeholder.

Use your user API Key for your password:

--auth-password S8PHFSJyyc7GuYbJ2SHFVq

*** Note: You must use your real user account API Key above, not "S8PHFSJyyc7GuYbJ2SHFVq", it's a placeholder.

Putting it all together:

A successful message will look something like the following:

Using your ESP platform's custom SMTP headers with SWAKS:

Tag your message:

--header "X-Transactional-Tag: SWAKS"

Choose a postal route for this message:

--header "X-Transactional-Route: AjdytEc4dzfYhuk9nWCq6Y"

*** Note: You must use the real postal route ID above, not "AjdytEc4dzfYhuk9nWCq6Y", it's a placeholder.

Use a transactional template for this message instead of --body:

--header "X-Transactional-Template: MsmsEaZZDxYyBJyVXXwA2A"

*** Note: You must use the real transactional template ID above, not "MsmsEaZZDxYyBJyVXXwA2A", it's a placeholder.

ChatGPT is an expert SWAKS user.

Ask it how to do anything you need to test with SWAKS and it will know.

Last updated