We usually use the Telnet command to detect whether a port is a pass, but it functions much more than that. It can be used for landing, and can be used to send mail. The following is a complete example.
[root@d23334634]# telnet smtp.111cn.net 25
Trying 42.120.219.29 ...
Connected to Smtp.111cn.net.
Escape character is ' ^] '.
smtp.aliyun-inc.com MX alimail Server (10.147.40.200)
Helo 123--You can enter some characters randomly, not necessarily "123". To say hello to the server.
Ok
Auth Login--then enter AUTH login and start landing
334 Dxnlcm5hbwu6
d2viqgrhaxhpyw9ydwkuy29t-Mailbox name base64 (such as: Web@111cn.net base64 after the d2viqgrhaxhpyw9ydwkuy29t)
334 Ugfzc3dvcmq6
Qdgwehhh333333--post-mail password base64
235 Authentication Successful
Mail From:<web@111cn.net>--sender's mailbox
Mail Ok
RCPT to:<446673330@qq.com>--recipient mailboxes, can be multiple
RCPT Ok
Data--Start entering the sender information
354 End data with <CR><LF>.<CR><LF>
From:web@111cn.net
Subject: Here is the title of the message
Here is the body of the message and note that you want to empty one line above. --note that after the title is lost, you need to empty one line
Body text, abcdefg www.111cn.net Hello hello.
.
Data ok:queued as Freedom