Jump to content
xisto Community
Sign in to follow this  
jmb2006

Sending + Receiving Email Via Telnet using email via the command line.

Recommended Posts

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".

 

'o' -> Open

'smtpserver.host.domain' -> Connection to Server

'smtpserverport' -> On This Port

 

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

im not sure about the subject GOOGLE IT!!

 

anyway now your ready to start typing your message.

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.

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.

Share this post


Link to post
Share on other sites

telnet isnt the safest protocol to use nowadays..

Agreed. Besides, most email providers has blocked access to foreign protocols, especially from using telnet, to prevent spam. Telnet was a common tool that spammers used in the pass to send multiple spam messages using the email server's smtp servers. Now many access to these SMTP servers are already blocked. Otherwise, you will need an account to that email server, and a new guide will be needed to do in another way.

Nice findout. I've tried that some years back. Now it doesn't work on hotmail and yahoo anymore.

Share this post


Link to post
Share on other sites

I think nowasdays ISP are very very strict as far as email is concerned. My ISP even blocked access of their POP and SMTP servers outside the IPs that they give out! Port 25 is blocked by default and mail relay is impossible with my ISP. Probably, there are really too much SPAM out there, but I suspect that they want to charge more by blocking some of the service.

Share this post


Link to post
Share on other sites

That's a good tutorial for telnet users, thanks.But now people use personal smtp servers, like for example, there's a very good one named: "free smtp server".With free smtp server you can send your own messages without passing them thrue servers, you send the email right to the receivers email inbox, like this you don't take the risk of people getting important emails with sensible data.Just install free smtp server, then run it, now open your email client (i use advanced emailer, but there's more, for instance, outlook express, pegasus, etc...) and configure the smtp server (as the name of the smtp server you just have to type: localhost and port 25) and now you can start sending emails without external smtp servers from free or pay email servers on the internet.

Edited by Lyon2 (see edit history)

Share this post


Link to post
Share on other sites

how i cleare the error

Sending + Receiving Email Via Telnet

 

Sir,

I want to send a mail to smtp server form my program in php.So first I will try to connect to the smtp server using fsockopen() function in php.

But the smtp server can not connected.That will say the error report:

 

"[Wed Feb 06 17:37:38 2008] [error] [client 0.0.0.0] PHP Warning: fsockopen() [<a href='http://forums.xisto.com/no_longer_exists/;]: unable to connect to 192.168.0.250:25 (An established connection was aborted by the software in your host machine.areand) in see:Program FilesApache Software FoundationApache2.2htdocshotpaksrcutilfile.Php on line 35".What I do please help me to currect error.

 

By

Hariprasath

Chennai

 

-reply by hariprasath

Share this post


Link to post
Share on other sites

post a hyperlink ?

Sending + Receiving Email Via Telnet

 

Hi

 

I am able to telnet SMTP server and send emails.I am just wondering if I can post a hyperlink on the data section of the email.I did try but in vain.. Kindly help me.Thanks

 

 

-reply by Arun

Share this post


Link to post
Share on other sites

receiving email code using php

Sending + Receiving Email Via Telnet

 

HAy

how can I creat a funcion in php that will receiving email

using PHP

 

-reply by mohsin

Share this post


Link to post
Share on other sites

Intermitten telnet connection

Sending + Receiving Email Via Telnet

 

Hello,

 

I am trying to stablish a telnet connection using cmd. When I start up my windows XP machine I am able to stablish the connection. However, a few hours later, the connection fails when I try to connect and I get the following message:

 

Connecting to 'smtpserver.Host.Domain'...Could not open connection to the host, on port 25: connect failed.

 

I am only able to re-stablish a connection when I reboot my machine.

 

Any ideas.

Share this post


Link to post
Share on other sites

Telnet connection problem

Sending + Receiving Email Via Telnet

 

Hello,

 

I am trying to stablish a telnet connection using cmd. When I start up my windows XP machine I am able to stablish the connection. However, a few hours later, the connection fails when I try to connect and I get the following message:

 

Connecting to 'smtpserver.Host.Domain'...Could not open connection to the host, on port 25: connect failed.

 

I am only able to re-stablish a connection when I reboot my machine.

 

Any ideas.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.