PHP in the telnet command to send a message demo

Source: Internet
Author: User
Tags auth base64

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.