Telnet 25 - checking email connections

As I use this frequently to test remote mail hosts for one of my clients, I figure it deserves a spot here. This will allow you to manually test a remote mail server using telnet and port 25:

First get the mail server address for a website. We will use for our example:

dig mx
...  1654  IN  MX  50  1654  IN  MX  5  1654  IN  MX  10  1654  IN  MX  10  1654  IN  MX  50

Not sure if there is a specific mail server to choose, but I usually choose one with a higher priority. In this case I will choose to test from my server:

telnet 25
    Connected to (
    Escape character is '^]'.
    220 ESMTP y37si31029380iky.4
    250 at your service
    MAIL FROM:<>
    250 2.1.0 OK y37si31029380iky.4
    RCPT TO:<>
    250 2.1.5 OK y37si31029380iky.4
    354  Go ahead y37si31029380iky.4
    This is a test.
    250 2.0.0 OK 1230083982 y37si31029380iky.4
    221 2.0.0 closing connection y37si31029380iky.4
    Connection closed by foreign host.

A few notes:
On most email servers you do NOT need to include the < or > tags around the email address. Stricter mail servers require it. On gmail if you do not include them you get a nasty '555 5.5.2 Syntax error'.
Don't do anything nasty or stupid, as you can be easily traced through the remote servers mail log. This how-to is to help remind me and to help you trouble shot potential email issues with remote servers, or even to your own server.