Skip to content
Bots!
Bots!
  • About
    • Myself
    • আমার দোয়া
  • Bookmarks
    • Bookmarks
    • My OCI Bookmarks
    • Useful Proxmox Commands & Links
    • Learning Nano
    • Useful Sites
    • Useful Virtualbox Command
    • Useful MySQL Command
    • Useful Linux Command
    • BTT-CAS
  • Resources
    • Webinar on Cloud Adoption for Project Managers
  • Photos
  • Videos
  • Downloads
Bots!

Sending and Receiving mail using Command line through telnet

Rumi, July 10, 2008

Ok first off im no good at writing tutorials so feel free to flame me (hey that rymes). Anyway in this tutorial i will basically show you how to send and receive email via the command-line terminal emulation program called Telnet. Now where shall i start, hmm.. Sending Email!!

Sending Email

Sending email requires a special type of server called an SMTP server (SMTP -> Simple Mail Transfer Protocol). SMTP is the protocol used to send email just like POP is the protocol used to receive. Now by default and most commonly SMTP servers run on port 25. To describe a port i will have to basically describe a connection. Think of a server as a block of flats/apartments and each flat/apartment (with its own individual number) is a port, so a port is just a way into another system. Anyway back to SMTP servers, so to send email you need an smtp server, your email provider should have one (smtp server list at end of tutorial). Anyway once you have your smtp server open up msdos (cmd) by going to Start > Run and typing in cmd and pressing enter. Then open up telnet and type “o smtpserver.host.domain smtpserverport”.

Telnet mail.servername.com 25

Anyway once your into the server you should be greeted by whats called a banner, a banner is just a message displayed to a user once he/she connects. The banner should look like this:

220 SERVERHERE mail server

just type “helo SERVERHERE” to let the server know your there and ready to start commanding it.

next you need to establish where the email message is coming from so type:

mail from: youremail@youremailprovider.com

next you need to establish where the email message is going to so type:

rcpt to: receiver@theiremailprovider.com

type “data” press enter.

Enter your message and enter ‘.’ on a line by itself press enter to finish the message, the server should then send the message, next just type quit to leave the smtp server and your done!!

[SMTP Servers]
i will now list some common email providers smtp servers.
Gmail SMTP Server: smtp.gmail.com
Hotmail: mx1.hotmail.com
Yahoo: mx1.mail.yahoo.com
Other: contact your email provider for your smtp server.

Receiving Email!
Right now that thats out of the way time to move on to receiving email. Now just like sending email, receiving email also needs a special type of server, its called a POP server, POP = Post Office Protocol, the protocol created for the purpose of receiving email. When you send email your sending it to the receipitents POP server. The default port for POP servers is 110. Open up a command prompt like you did before and type:

telnet “POPSERVER” 110

next you need to login to the POP server, have your username and password ready.

type USER followed your username, press return then
type PASS followed by your password then press return and if everything is ok you should be logged in.

Next to see if you have any messages type LIST which will return your messages, you wont see the subjects but instead the size in bytes of the email, bit confusing i know. You will also see the id number of the email

e.g.
QUOTE
1) 1843
2) 7892
3) 9989

3 is obviously the largest email, to read the email you simply type:

RETR id

and finally to delete an email you type:

DELE id

well thats it for this tutorial hope you found it useful

Administrations

Post navigation

Previous post
Next post

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Myself…

Hi, I am Hasan T. Emdad Rumi, an IT Project Manager & Consultant, Virtualization & Cloud Savvyfrom Dhaka, Bangladesh. I have prior experience in managing numerous local and international projects in the area of Telco VAS & NMC, National Data Center & PKI Naitonal Root and CA Infrastructure. Also engaged with several Offshore Software Development Team.

Worked with Orascom Telecom-Banglalink, Network Elites as VAS partner, BTRC, BTT (Turkey) , Mango Teleservices Limited and Access to Informaiton (A2I-UNDP)

Currently working at Oracle Corporation as Principal Technology Solution and Cloud Architect.

You can reach me [h.t.emdad at gmail.com] and I will be delighted to exchange my views.

Tags

Apache Bind Cacti CentOS CentOS 6 CentOS 7 Debain Debian Debian 10 Debian 11 Debian 12 DKIM Docker icinga iptables Jitsi LAMP Letsencrypt Linux Munin MySQL Nagios Nextcloud NFS nginx openvpn pfsense php Postfix Proxmox RDP Softether SSH SSL Ubuntu Ubuntu 16 Ubuntu 18 Ubuntu 20 Varnish virtualbox vpn Webmin Windows 10 XCP-NG zimbra

Topics

Recent Posts

  • KVM Cloud Capacity Planning Script (Enhanced) February 20, 2026
  • Youtube MP3 Downloader Script using AI February 14, 2026
  • Install Softether VPN and create a Destination NAT (D-NAT) Rule to access the private Client VPN Node on a Debian 12 OS February 14, 2026
  • Deploying Pulse Monitoring for Proxmox Cluster Ecosystem February 13, 2026
  • Technitium DNS Web UI Configuration for Primary-Secondary Name Servers February 12, 2026
  • Technitium DNS with Primary-Slave Installation on Debian February 12, 2026
  • Install Docker and Docker Compose in Debian 12 February 5, 2026
  • Install GUI on Debian 12 using CLI February 4, 2026
  • Configuring Multiple PHP Versions on Virtualmin January 30, 2026
  • Deploy a Container TIG (Telegraf, InfluxDB and Grafana) Stack January 24, 2026

Archives

Top Posts & Pages

  • KVM Cloud Capacity Planning Script (Enhanced)
©2026 Bots! | WordPress Theme by SuperbThemes