Use telnet to log on to the SMTP service and send an email (with authentication)

Source: Internet
Author: User

The number of emails sent in the past few days is small.ProgramBy the way, I checked why SMTP mail servers such as 126 and Gmail cannot use the SMTP commands in the lab class to send emails. At that time, based on the returned information, I only knew that the server needed identity authentication.

Today, I finally found out how to telnet to the SMTP server with identity authentication.

Provide a base64 encoded URL http://www.motobit.com/util/base64-decoder-encoder.asp

The specific process is as follows:
Microsoft Telnet/> open smtp.126.com 25
220 126.com anti-spam GT coremail System (126com [071018])
Helo mail.126.com
250 OK
Auth login // use the identity authentication logon command
334 dxnlcm5hbwu6
Kjihgfedcba ==/enter the username that has passed base64_encode.
334 ugfzc3dvcmq6
Abcdefghijk = // enter a password that has passed base64_encode ().
235 authentication successful
Mail from: <yaochengxiang@126.com> // tell the address of the server sender
250 mail OK
Rcpt to: <yaochengxiang@gmail.com> // tell the server recipient's address
250 mail OK
Data

354 end data with <CR> <LF>. <CR> <LF>
To: yourframe@162.com // recipient address displayed in the mail
From: Iamahacker@gmails.com // The sender address displayed in the message
Subject: Test mail // subject, and press ENTER twice

Hello yaos


. // End the transfer letter
250 mail OK queued as smtp14, f0cpbfsuzuovodwe. 10982s2
Quit // disconnect
221 bye
Connection closed by foreign host.

 

Status Code Description:

220: Service ready

250: The request email is correct and completed (Helo, mail from, rcpt to, quit command execution will return this message)

235: certified

221: Processing

354: Start sending data and end with. (This message will be returned if the data command is executed successfully)

500: syntax error. The command cannot be identified

550: The command cannot be executed, and the email address is invalid.

552: interrupt handling: the user exceeds the file space

 

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.