May 16, 2008

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

Free Web Hosting, No Ads > CONTRIBUTE > Tutorials

free web hosting

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

jmb2006
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:
QUOTE
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:
QUOTE
mail from: youremail@youremailprovider.com


next you need to establish where the email message is going to so type:
QUOTE
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:
QUOTE
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:
QUOTE
RETR id


and finally to delete an email you type:
QUOTE
DELE id


well thats it for this tutorial hope you found it useful.

 

 

 


Reply

amhso
telnet isnt the safest protocol to use nowadays..

Reply

Inspiron
QUOTE(amhso @ Mar 18 2006, 03:41 PM) *

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.

Reply

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

Reply

ha.h.ngu
QUOTE(Inspiron @ Mar 19 2006, 07:58 AM) *

Now it doesn't work on hotmail and yahoo anymore.


I tried with yahoo 5minutes ago and it still works smile.gif

Reply

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

Reply

Trap FeedBacker
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='function.Fsockopen'>function.Fsockopen</a>]: unable to connect to 192.168.0.250:25 (An established connection was aborted by the software in your host machine.\are\and) in see:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\hotpak\\src\\util\\file.Php on line 35".What I do please help me to currect error.

By
Hariprasath
Chennai

-reply by hariprasath

Reply

Trap FeedBacker
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

Reply

Trap FeedBacker
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

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Recent Queries:-
  1. check smtp mail max size via telnet - 0.63 hr back.
  2. gmail telnet smtp commands - 7.27 hr back.
  3. php send email multiple message line tutorial - 7.36 hr back.
  4. sending via telnet - 7.50 hr back.
  5. checking email via command line - 8.28 hr back.
  6. telnet mail commands - 8.62 hr back.
  7. smtp.gmail.com "email form" php - 8.64 hr back.
Similar Topics

Keywords : sending, receiving, email, telnet, email, command, line

  1. Verifying Your Email Address
    A Simple PHP Tutorial. (0)
  2. How To Use Command Prompt As A Text Editor
    (5)
    In this tutorial, I will show you how you can use Command Prompt to create text files. It is very
    simple and you can also use it to write output from a command into a text file. This can be
    particularly useful when you need documentation from a DOS program in a text file when you use the
    help command or something similar. In order to do this you simply use this DOS command. echo
    Text >> test.txt This will create a new text file called test and echo the contents into it. If
    we wanted to write a 2 line document, we could do something like: echo Hello >> test.txt e....
  3. To Automatically Run Command When Login / Logoff
    (3)
    In case that you need login and / or logoff to execute some commands. You could do this with GPO
    login / logoff function. Here is step: 1.) Choose Start Menu -> Run -> type in gpedit.msc 2.)
    Expand User -> Windows Settings ->Script ( Logon / Logoff ) 3.) Double-Click either one and a dialog
    displayed 4.) Click the add button and then browse the command files that you wish to executed. The
    Script Parameters allowed you to pass any extra parameters to the command or applications. Click OK
    button. 5.) You command now should displayed on Name / Parameters List Box. Click O....
  4. Chat With Command Prompt
    (23)
    QUOTE Chat With Command Prompt If you want a private chat with a friend or client on you
    Network, you don't need to download any fancy program! All you need is your friends IP
    address and Command Prompt. Firstly, open Notepad and enter: @echo off :A Cls echo MESSENGER set
    /p n=User: set /p m=Message: net send %n% %m% Pause Goto A Now save this as "Messenger.bat". Open
    the .bat file and in Command Prompt you should see: MESSENGER User: After "User" type the IP
    address of the computer you want to contact. After this, you should see this: Message: Now ty....
  5. Verifying Email Addresses
    Using a simple PHP script (8)
    This simple script will allow you to run some basic checks to make sure that any email address
    entered is actually an email address. There is no guarantee offered that this will stop every single
    fake email address, but it'll provide some protection. Now, the code! First we need to get
    the email address to verify. Here, I get it using POST from an HTML form. CODE <?php //Load
    email address from web form $email = $_POST['email']; Now, we move on
    to our first check. Does the text that has been entered look like it could b....
  6. Php Mail Tutorial
    SENDING MAILS WITH PHP (0)
    Added code tags in BUT not accepting as we already have a mail tut. Pming user regrading code tags,
    credits have not been reduced.... First to send a mail with php we need to design an html form eg
    CODE <form action="mailsend.php" method="post"
    enctype="application/x-www-form-urlencoded" name="form1">    <table
    width="75%" border="0">      <tr>      
     <td><strong><font
    size="4">Subject</font></strong></td>        <td><i....
  7. Secure The Email Addresses On Your Website!
    Wonderful script and useful! And working (10)
    Just follow the instructions below: /* Secure Email Function by Juan Karlo Aquino de
    Guzman Website: http://www.karlo.ph.tc and http://www.abs-cbn.ph.tc E-mail:
    http://www.karlo.ph.tc/send.php Usage: showEmail("support@microsoft.com",0); OR
    showEmail("support@microsoft.com",1); Types: 0 = ordinary random 1 = more secure random To
    include to a script: include_once("email_secure.php"); */ And here is the code :
    CODE <?php /*     Secure Email Function by Juan Karlo Aquino de Guzman     Website:
    http://www.karlo.....
  8. Email Script/form With Php
    how to make a simple email script using php (35)
    Today, I'm going to show you how to make an email script using PHP and HTML. Most people usually
    put Email me if they want an email link on their site, but there are several cons to this.
    First, it's very inconvenient for those people who use web-based mail such as Yahoo!,
    Hotmail, or Gmail because that darn Micro$oft Outlook program comes up if one accidently click
    the link. Second, you are very suseptible to spam bots because they scan your HTML source code for
    anything with the same pattern as an email address and add it to their database. If yo....
  9. How To Check Email Headers?
    (9)
    Well, I didn't think of making this topic here, till one of the members asked me how to retrieve
    full email headers. It's quite simple actually. In Yahoo! click on the Full Headers
    link on the right hand top corner of the message table. You will see all the headers. In GMail
    Click on the More Options link. Then click on show original . There you go! Googlue!....
  10. Php Emailer/contact System
    An email or contact system for your site (20)
    Hello all, Here is an easy Emailer or Contact system that allows visitors or members of your site
    to email you just by filling out a form. So here is what you need to do to set it up. First open up
    a new page in your text editor and paste in the following code. CODE <?php $Name =
    $_POST['Name']; $Subject = $_POST['Subject'];
    $Email = $_POST['Email']; $Site =
    $_POST['Site']; $Message=$_POST['Message'];
    $align = $_POST[&#....
  11. Mail Form (php)
    This is a great email form script. (3)
    save this page as formmail.php Code: QUOTE $MailTo = "your email"; $MailSubject
    = "contact"; $MailHeader = "From: $s1"; $MailSent = "Put here the information you
    want to be shown after the message is sent."; if ($s1 == ""){ echo "You did not put your
    name ."; } else { $MailBody = "Name : $s1\n"; } if ($s2 == ""){ echo "You did
    not put your E-Mail ."; } else { $MailBody .= "Email : $s2\n"; } if ($s3 ==
    ""){ } else { $MailBody .= "Message : $s3\n"; } { mail($MailTo....

    1. Looking for sending, receiving, email, telnet, email, command, line

Searching Video's for sending, receiving, email, telnet, email, command, line
advertisement



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



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE