Telnet to SMTPServer to send an email

Source: Internet
Author: User
Tags smtp auth
Telnet to SMTPServer to send an email-Linux Enterprise Application-Linux server application information. The following is a detailed description. In modern network environments, Mail Relay is a hot topic. How to allow external users or mobile users to perform Mail Relay on the company's email server is the focus of attention. With the emergence of standardized SASL authentication and the support for smtp auth in the new version of Sendmail, the problem has gradually become clear and easy to solve. This article is an application instance that uses Telenet to log on to the Mail Server and send emails via SMTP Server. In Unix/Linux systems, if you use Telnet to test whether a system Service is started, you only need to enter the "Telnet Host IP Address" to verify the Service startup status, in addition, it can further input and interact with the Server, and then use Telnet to log on to a Mail Server and send a letter for testing (provided that the connected Mail Server can perform Relay, otherwise, it will be processed by the Mail Server as an advertisement spam ).

Procedure

1. First, connect to the Server IP address and Service port. Assume a domain name "www.1234567.com" and run the following command:

# Telnet http://www.1234567.com/25



After connecting to the Server, you will get the relevant information, as shown below:

220 http://www.1234567.com/ESMTP Sendmail



2. Next, say hello to Sever ". First, report your name (assume it is a user in the "aaa. bbb. ccc" Domain) and log on to the Mail Server. The Code is as follows:

Helo aaa. bbb. ccc



At the same time, the Mail Server will also "respond" to the host and domain where it is located, so that you can intuitively see the current system, as shown below:

250 http://www.1234567.com/



3. Click "report" e-mail box (case-insensitive). Note that a space is left after the colon, for example, the following code:

Mail from: abc@aaa.bbb.ccc



Server Response (Code 250 indicates normal:

250 abc@aaa.bbb.ccc Sender OK



4. Then, you must enter the recipient's email (case-insensitive). Also, note that a space is left behind the colon. The Code is as follows:

Rcpt to: admin@test.com



Server Response (Code 250 indicates normal:

250 admin@test.com Recipient OK



5. Enter "data" to start entering the email content, as shown below:

Data



Under normal circumstances, the Mail Server will first give a "prompt ". After finishing the email content, enter a "." symbol at the beginning of the new line to end. The Code is as follows:

354 End data .



6. then, follow the "mime-version:", "from:", "to:", "cc:", "subject:", and "content-type: and other fixed formats. This information is optional and does not affect the sending of E-mail. It makes the display of E-mail and the mail header complete, as shown below:

Mime-version: 1.0 from: Ma to: Mom cc: Ma Subject: this is a test email... cccc Content-Type: text/plain; charset = "GB2312"



7. Press the Enter key twice. This is the operation specified in RFC 882.

8. Now you can enter the email body.

9. After the text is written, enter a "." number in a blank line and press the Enter key. The following message is displayed, indicating that the Mail Server is about to send an email:

250 OK: queued as B10B51781D



Operation Review

The code for the entire operation process and the "communication" process after logging on to the Mail Server is as follows:

Telnet http://www.1234567.com/25



Shown as follows:

220 http://www.1234567.com/ESMTP Sendmail helo aaa. bbb. ccc 250 http://www.1234567.com/mail from: abc@aaa.bbb.ccc 250 abc@aaa.bbb.ccc Sender OK rcpt to: admin@test.com250 admin@test.com Recipient OK data 354 End data . Mime-version: 1.0 from: Ma to: Mom cc: Ma Subject: this is a test email... cccc Content-Type: text/plain; charset = "GB2312" AAAAAAAAAAAAAAAAA bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbsmall. 250 OK: fig

Note: press Ctrl +] to disconnect the connection; enter the quit command to exit.
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.