Use SMTP mail _ to send mail using SMTP to send mail _ _ _ push mail User Guide - Ali cloud https://help.aliyun.com/knowledge_detail/51622.html
Sending mail through the SMTP protocol overall process is as follows:
- The client uses the telnet command to connect to the SMTP server, a session is established.
- The client sends a HELO or EHLO command.
- The client sends a command AUTH authentication for user login (using smtpd way).
- The client sends a MAIL command specifies the sender.
- The client sends a RCPT command specifies the recipient.
- The client sends a DATA command ready to enter the body of the message.
- Client sends a Command (Command dot) indicates the end of the DATA command.
- The client sends a QUIT command to end the session.
Examples
To help you get familiar with the process to send mail using SMTP protocol, the following command telnet session example, to describe the SMTP command session.
Note : where S represents the server, C behalf of the client. You can use the Linux command echo -n Content | base64 base64-encoded.
$telnet smtpdm.aliyun.com 25
S:220 smtp.aliyun-inc.com MX AliMailServer(127.0.0.1)
C:EHLO test.com
S:250-smtp.aliyun-inc.com
S:250-8BITMIME
S:250-AUTH=PLAIN LOGIN XALIOAUTH
S:250-AUTH PLAIN LOGIN XALIOAUTH
S:250-PIPELINING
S:250 DSN
C:AUTH LOGIN
S:334 dXNlcm5hbWU6
C:dGVzdEB0ZXN0LmNvbQ==备注:用户名test@test.com的base64编码
S:334UGFzc3dvcmQ6
C:dGVzdA==备注:用户密码test的base64编码
S:235Authentication successful
C:MAIL FROM:<test@test.com>备注:注意用<>将发件人扩起来
S:250MailOk
C:RCPT TO:<test@test.com>
S:250RcptOk
C:
S:354End data with<CR><LF>.<CR><LF>
C:subject: test
C:from:<test@test.com>
C:to:<test@test.com>
C:
C:test
C:.
S:DataOk: queued as freedom ###envid=148316944
C:QUIT
S:221Bye