Connect to SMTP Server
telnet servername 25
Manually send email
> EHLO myservername
< 250-servername (and other text)
> MAIL FROM: bob@bob.com
< 250 ok > RCPT TO: alice@alice.com
< 250 ok > DATA < 354 go ahead

After these commands, the email message with headers then body is included.

To end and send the message

.

That is a single period on the line. To have a line with a single period, use two periods

Connect using TLS
openssl s_client -crlf -starttls smtp -connect servername:25 -quiet
Create encoded values for login.

Create encoded username and password for AUTH PLAIN

perl -MMIME::Base64 -e 'print encode_base64("username\000username\000password")'

Create encoded username or password for AUTH LOGIN

perl -MMIME::Base64 -e 'print encode_base64("username_or_password")'
AUTH PLAIN
> EHLO myservername
< 250-servername (and other text)
> AUTH PLAIN <base64 username AND password from above>
< 235 ok
AUTH LOGIN
> EHLO myservername
< 250-servername (and other text)
> AUTH LOGIN
< 334 VXNlcm5hbWU6
> <base64 username>
< 334 UGFzc3dvcmQ6
> <base64 password>
< 235 ok