Send email with OpenSSL

It is possible to connect to a mail server using openssl(1). From this connection, an email can be manually crafted and sent.

First, find the MX records for the mail server. Then, attempt a tcp connection on port 25 using openssl(1):

$ dig -t mx example.com
;; ANSWER SECTION:
example.com.              395     IN      MX      1 mx1.example.com.
example.com.              395     IN      MX      1 mx2.example.com.
example.com.              395     IN      MX      1 mx3.example.com.
$ openssl s_client -starttls smtp -connect mx1.example.com:25
CONNECTED(00000003)
depth=2 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert High Assurance EV Root CA
verify return:1
depth=1 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert SHA2 High Assurance Server CA
verify return:1
depth=0 C = US, ST = California, L = Sunnyvale, O = Oath Inc, CN = *.example.com
...
250 STARTTLS