How to use Telnet to send email over Port 25 using SMTP
A popular request coming in is from students who wish to become more proficient in general computing topics. For this, we at AskStudent will be writing a series of articles such as this article where we will talk about the Telnet command and how you can use it to access your mail server using Port 25 and sending an email to someone using nothing but your command prompt.
How to send Email using Telnet command over port 25 using the SMTP protocol
Telnet: TELNET (TELetype NETwork) is a network protocol used on the Internet or local area network (LAN) connections. It was developed in 1969 and standardized as IETF STD 8, one of the first Internet standards. Read more about Telnet in the Wikepedia article here
SMTP: Simple Mail Transfer Protocol (SMTP) is the de facto standard for e-mail transmissions across the Internet. Read more about SMTP in this Wikipedia article here
Step # 1: First, open a command prompt. To open a command prompt window, click Start, Run and then type in cmd and press Enter. You can also press the
Step # 2: You need to know a remote mail server. If you are still in school or working, there is the excellent opportunity to use your University mail server or your company’s mail server for this.
type in telnet RemoteMailServer 25 at the command prompt. The Remote mail server here in this command is the mail server of your school or company. It is usually mailhost.
Step # 3: Introduce yourself to the mail server. Play around a bit.
type in helo mailhost at the command prompt. The mail server responds back with something like this
250 RemoteMailHost. Hello
Step # 4: You can now enter your email address.
type in mail from: your email id @ blah.com
The mail server responds back with a 250
Step # 5: You can now enter your receipient’s email address
type in rcpt to: recipient email id @ blah.com
The mail server responds back with a “Recipient OK” message
Step # 6: Now, you are ready to type in the body of the email message.
type in data and press enter.
Now, type your message and then finally press Enter. To end your message type in a single period “.” . Your message is now in the queue
Step # 7: To complete and finish the process, type in quit and press enter. The mail server responds with a “Bye” after which you see a “Connection to host lost” message displayed.
If you liked this article, click here to buy me a beer!
Dear visitor, thanks for dropping by. If you enjoyed reading this post, you may want to subscribe to my RSS feed. It could could win you some great prizes this month. Thanks for visiting!
Get FREE Norton AntiVirus, provided to you by Google and AskStudent
Related Posts
- How to Restore your Computer to a previous Windows Operating System after installing Windows Vista
- How to access Yahoo! Mail using Microsoft Outlook
- Open Command Prompt Here Window on a Folder in Windows Vista
- Demonstration of Windows XP Privilege Escalation Exploit
- How to Recall or Replace an Email Message

I couldn’t get it to work. It just closed when i tried it with my gmail (google email) account and with my yahoo account. Could someone help me?
I dont think it will work with outside mail servers. You have to be with the network, like business or school network.
not true lost, it should work with outside mail servers as well. you may have port 25 blocked by your ISP?
Hi, I tried to make it work with yahoo but its asking for username and password, dunno how to give username and password. this is what i did
telnet smtp.mail.yahoo.com 25
// I got this message: 220 smtp…. ESMTP
then i typed: helo
// i got this message: 220 smtp…
then i typed: mail from: xyz@yahoo.com
// i got this message: 530 authentication required … connection to host lost.
can any1 help me!!!
thanks.
i cant have access to my telnet network. i alwys receive non valid command when i send my telnet. please can someone help me
Can you tell me if i can attach any file from command prompt.
The same problem of tejas s surve…is possible to attach a file( may be after encoding it using a MIME encoding)?
mail -s “subject” email-address < filename to be attached.
mutt -s “Test Mail” -a
helo xyz
250 mail2.xyz.com
mail from:abc@xyz.com
250 Ok
rcpt to:cba@xyz.com
504 : Helo command rejected: need fully-qualified hostname
Please can any one respond to me where i need to give the FQDN….
I am having a problem with gmail just like the first poster.
The problem is that it asks to “STARTTLS” so i type “STARTTLS”
STARTTLS begins.. and then i type the MAIL FROM command and it just closes…