Subscribe

RSS Feed (xml)

Powered By

Powered by Blogger

2016年3月9日 星期三

How to Send Email via Telnet

Note: For Windows XP, Windows 2003, the "Telnet" client be installed however Windows 7/8/8.1/10 and Windows Server 2008/2012 need to install it first.

Installing the "Telent" client for Window 7

To Install the "Telnet" client on a Windows 7 computer use these steps.
  1. Open the Control Panel
  2. Click on Programs
  3. Click on Turns Windows Features on or off
  4. select the box of "Telnet" client
  5. Click OK and close the Control Panel
Install the "Telent" client for Server 2008 R2

To install the Telnet client on Windows Server 2008 R2 use these steps.

Open a PowerShell windows and run the following command.
PS C:\> Import-Module servermanager
PS C:\> Add-WindowsFeature telnet-client
Success Restart Needed Exit Code Feature Result
------- -------------- --------- --------------
True No Success {Telnet Client}

Sending Email from the command line via "Telnet"
Open a command prompt and use Telnet to connect to the remote email server on port 25
C:\> telnet remotedomainaddress.com.hk 25

If Telnet is able to connect to the remote server, you should see the following message from remote email server.
220 remotedomainaddress.com.hk ESMTP (58ee44f84383b3426daf5dc72a084f92)

Send the HELO command to remote email server
helo <test.com>
250 remotedomainaddress.com.hk Hello <test.com> [123.123.123.123], pleased to meet you

Use MAIL FROM command to tell the remote server who the email is from
mail from: <test@test.com>
250 Sender <test@test.com> OK

Use RCPT TO command to tell the remote server who to deliver the email to
rcpt to: <test@remotedomainaddress.com.hk>
250 Recipient <test@remotedomainaddress.com.hk> OK

Use data command to start email content
data
354 Start mail input; end with <CRLF>.<CRLF>

Use SUBJECT and then type your subject line, and press enter.
subject: testing email

Type any text you want to include with the message, press enter, and then finally type a period “.” and press enter to send the email.
this is email content.
.
250 OK: queued as E108A2E40AC

Type the QUIT command to terminate the connection when you’re done.
quit