Test SSL SMTP from command line

To generate auth code use following command:

perl -MMIME::Base64 -e 'print encode_base64("\000USERNAME\@gmail.com\000PASSWORD")'

Do not forget to change USERNAME and PASSWORD.

Output will be something like this:

AZ1hcb1oZW5rb25hbGV4Y45kckBn5WFpbC8jb20ADTM0NDk0MA==

SMTP.GMAIL.COM

openssl s_client -connect smtp.gmail.com:465 -crlf -ign_eof

EHLO localhost
AUTH PLAIN AZ1hcb1oZW5rb25hbGV4Y45kckBn5WFpbC8jb20ADTM0NDk0MA==
MAIL FROM: <[email protected]>
RCPT TO: <[email protected]>
DATA
Subject: TEST

TEST
.
QUIT

SMTP.UKR.NET

openssl s_client -connect smtp.ukr.net:465 -crlf -ign_eof

EHLO localhost
AUTH PLAIN AZ1hcb1oZW5rb25hbGV4Y45kckBn5WFpbC8jb20ADTM0NDk0MA==
MAIL FROM: <[email protected]>
RCPT TO: <[email protected]>
DATA
Subject: TEST

TEST
.
QUIT

As to usual smtp:

telnet 192.168.5.1 25

EHLO localhost
MAIL FROM: [email protected]
RCPT TO: [email protected]
DATA
TEST
.
QUIT