Use telnet to manually send and receive SMTP/pop mails

Source: Internet
Author: User

Note: manual input is represented in a blue font, and # is followed by a comment, which cannot be entered.

========= Calculate the base64 encoded username and password first, Used for authentication login ==========
[Crazywill @ localhost crazywill] $Perl-mmime: base64-e 'print encode_base64 ("crazywill ");'
Y3jhenl3awxs

[Crazywill @ localhost crazywill] $Perl-mmime: base64-e 'print encode_base64 ("mypassword ");'
Bxlwyxnzd29yza =

================================ Start the SMTP mail sending operation ==========================================

[Crazywill @ localhost crazywill] $ Telnet smtp.163.com 25 # Telnet port 25
Trying 202.108.5.81...
Connected to smtp.163.com.
Escape Character is '^]'.
220 163.com coremail SMTP (Anti Spam) System
EHLO smtp.163.com # Handshake
250-mail
250-pipelining
250-auth login Plain
250-auth = login Plain
250 8 bitmime
AUTH LOGIN # Start authentication Login
334 dxnlcm5hbwu6
Crazywill
334 ugfzc3dvcmq6
Mypassword
535 error: authentication failed # login failure due to direct user name and password
AUTH LOGIN
334 dxnlcm5hbwu6
Y3jhenl3awxs
334 ugfzc3dvcmq6
Bxlwyxnzd29yza =
235 authentication successful # log on successfully using base64 encoding
Mail from: < Test@163.com > # Sender
553 you are not authorized to send mail, authentication is required # mail cannot be forged
Mail from: < Crazywill@163.com > # Sender
250 mail OK
Rcpt to: < Crazywill@163.com > # Recipient of the email. If multiple recipients exist, repeat this statement multiple times.
250 mail OK
Data # Body content
354 please start mail input.
To: Crazywill@163.com # Here, the to, from, and other content can be fake at Will :) you can lie, but you can't lie to anyone who knows how to view the mail source code.
From: Cccc@163.com
Subject: Test by Telnet/SMTP

Test, just a test.# The Body of the email, with a blank line from the header
. # After the email is written, enter the result with a period and press Enter.
250 mail OK queued as smtp10, wkjadq2apxrnnqbe0cwaew = =. 38326s3 # If 250 is returned, the message is sent successfully.
Noop# Empty statement, which does not execute any operation. It is generally used to maintain connection with the server and do not drop the line
250 OK
Quit# Exit
221 closing connection. Good bye.
Connection closed by foreign host.
[Crazywill @ localhost crazywill] $

================================ Start the POP3 mail receiving operation ==========================================

[Crazywill @ localhost crazywill] $ Telnet to pop.163.com 110 # Telnet logon to port 110
Trying 202.108.5.104...
Connected to pop.163.com.
Escape Character is '^]'.
+ OK Welcome to coremail mail POP3 server (163com [20050206])
User crazywill # Username
+ OK core mail
Pass mypassword # Logon Password
+ OK 254 message (s) [27676669 byte (s)]
Stat # Viewing email status
+ OK 254 27676669
List # Mail List
+ OK 254 27676669
1 2468
2 21945
3 33136
4 2071
5 3364
6 18906
7 3136
8 24764
.................

Top 254 0 # View the email header of a specified email. "0" indicates that the entire email header is displayed. Other positive integers indicate that the number of returned rows is limited.
+ OK core mail
Received: From smtp.63.com (unknown [58.252.70.158])
By smtp5 (coremail) with smtp id wkjredra9giffqlejcnrag =. 29062s4;
Mon, 03 Jul 2006 21:07:18 + 0800 (CST)
To: Crazywill @ 163.com
From: cccc@163.com # Here is a fake wig before sending information, usually normal operation only show this.
Subject: Test by Telnet/SMTP # subject
Message-ID: <44a91687. 0e6f6c. 07562>
Date: Mon, 3 Jul 2006 21:07:19 + 0800 (CST)
Sender: crazywill@163.com # here is the real sender and cannot be forged.

.
RETR 254# Getting a specified email
+ OK 354 octets
Received: From smtp.63.com (unknown [58.252.70.158])
By smtp5 (coremail) with smtp id wkjredra9giffqlejcnrag =. 29062s4;
Mon, 03 Jul 2006 21:07:18 + 0800 (CST)
To:Crazywill@ 163.com
From: cccc@163.com
Subject: Test by Telnet/SMTP
Message-ID: <44a91687. 0e6f6c. 07562>
Date: Mon, 3 Jul 2006 21:07:19 + 0800 (CST)
Sender: crazywill@163.com

Test, just a test.
.

Dele 254 # Delete 254th emails
+ OK core mail
Stat # Viewing email status
+ OK 253 27676315
Quit # Exit
+ OK core mail
Connection closed by foreign host.
[Crazywill @ localhost crazywill] $

===========================================================================

Question:
How do I send data to multiple users, CC, and BCC?

Answer: (snifferpro listens to outlook and sends multi-user emails for analysis.)
Send/CC the same letter to multiple users. After mail from: <...>, use rcpt to: <...>
Each time an email address is sent, Rcpt is sent to the number of recipients.

CC, BCC, to, and other information written in data only displays data.And has nothing to do with the actual recipient.

Difference between CC and BCC: both are specified recipients of rcpt to, but the mail clientProgramThe BCC recipients are not written to the data to be transferred.

===========================================================================

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.