Send emails through AhaSend’s SMTP servers directly from your terminal using Swaks, a powerful command-line tool designed for testing and debugging SMTP servers. Perfect for scripting, automation, and troubleshooting email delivery issues.
What is Swaks? Swaks (Swiss Army Knife for SMTP) is a versatile, scriptable tool for testing SMTP servers and sending emails from the command line. It supports TLS encryption, various authentication methods, and is designed as a diagnostic tool rather than for high-volume sending.
Use sandbox mode to safely test your email integration:
Copy
swaks \ --from[email protected] \ --to[email protected] \ --server send.ahasend.com \ --port 587 \ --auth plain \ --tls \ --auth-user 'YOUR_SMTP_USERNAME' \ --auth-password 'YOUR_SMTP_PASSWORD' \ --header 'Subject: Sandbox Test Email' \ --add-header "AhaSend-Sandbox: true" \ --add-header "AhaSend-Sandbox-Result: deliver" \ --body "This email is sent in sandbox mode for testing."
Sandbox Benefits: Emails sent in sandbox mode are free, trigger webhooks normally, and never actually deliver to recipients - perfect for development and testing.
Pro Tip: Start with sandbox mode and basic commands before building complex automation. Use environment variables for credentials and always test scripts thoroughly before production use.