I hadn’t seen this tool before so I figured I would share. Swaks is the swiss army knife SMTP according to the homepage.
I’ve covered testing email from the command line before but this tool sure makes it easier.
swaks --to [email protected] --from [email protected] *** MX Routing not available: requires Net::DNS. Using localhost as mail server === Trying localhost:25... === Connected to localhost. <- 220 cmdln-laptop ESMTP Exim 4.69 Thu, 16 Apr 2009 12:23:24 -0500 -> EHLO cmdln-laptop <- 250-cmdln-laptop Hello localhost [127.0.0.1] <- 250-SIZE 52428800 <- 250-PIPELINING <- 250 HELP -> MAIL FROM:<[email protected]> <- 250 OK -> RCPT TO:<[email protected]> <- 250 Accepted -> DATA <- 354 Enter message, ending with "." on a line by itself -> Date: Thu, 16 Apr 2009 12:23:24 -0500 -> To: [email protected] -> From: [email protected] -> Subject: test Thu, 16 Apr 2009 12:23:24 -0500 -> X-Mailer: swaks v20061116.0 jetmore.org/john/code/#swaks -> -> This is a test mailing -> -> . <- 250 OK id=1LuVJ6-0007ge-Jf -> QUIT <- 221 cmdln-laptop closing connection === Connection closed with remote host.