corycollier.com | Web Development and System Administration

Often, I get asked by folks why an e-mail didn’t reach someone. People get an email that has some cryptic message about why their email didn’t reach it’s intended recipient. While there are an untold number of reasons as to why that could happen, there are a few things you can do to narrow down why it failed.

Regardless, the first thing I always do, is check that the email address is valid. It might sound funny, but just like that hot girl might have given you a phony number, you might have the wrong email address. This happens a lot more often then you might think.

So, how do you check the email? Enter Telnet to the rescue. Don’t worry, Telnet is cross platform. If you have Linux, Mac, or Windows (geez), you can use Telnet to figure out if the e-mail address you’re trying to reach is valid. It’s one of the few things that seem to work on damn near any operating system you can think of.

Sooo go ahead and fire up Terminal (or Command Prompt). Once you’ve gotten that done, you’ll need to type in ‘telnet’. You’ll see a window, something similar to the one below:

Now, you’ll need to get the domain name of the mail server you’re trying to check the email address against. This is not as easy as just checking the domain name itself. Nearly always, the mail server for a domain is mail.domain.com. So, if you’re checking the valid email address for JoeBalls@physics.org, then the mail server is probably mail.physics.org. It’s a much bigger topic than I’ve got to cover here. I’ll get to that later. So let’s just say the right email server is mail.physics.org. 

So, type in ‘open mail.physics.org smtp’ in the command prompt. In case you’re a little confused, it should look like the following:

So, after you enter this, you’ll see the telnet program try to connect to an IP address. If it works, then you’ll get a message about an escape character, as well as the mail server’s welcome message. If you’ve gotten here, then pat yourself on the back. You’ve at least gotten a valid mail server. We’ll assume for now, it’s the right one.

The next thing to do, is type in the following command: ‘HELO mail.example.com’. It’s probably more effective to use a valid mail server for this, but this is supposed to be a simple tutorial. So anyways, after you type in ‘HELO …’, you’ll see something similar to the following:

This is kinda like saying ‘Hi, I’m Cory’. Ehh, don’t worry about it. Now, you’ll have to enter who this test email is from. Usually can use anything that looks like a valid email address. I usually use dude@example.com. So, here it is:

 

So, the way to check the validity of the email (That’s right, we’re at the climax …. drumroll please ….), is to type ‘RCPT TO:’ and the email address you want to check. I’m using Gmail as a mail proxy these days, so I don’t mind handing out my email address: corycollier@corycollier.com. Go ahead and spam me, I dare you. ;)

Yeah, so go ahead and test that email. So, it looks like ‘RCPT TO: corycollier@corycoller.com’, and a visual representation looks like:

Wait, it didn’t tell me anything??!?

Ahhh, but yes it did. This mail server returned a number, before it returned anything else. That number, is ALWAYS a three digit number. 2xx, 3xx, 4xx, or 5xx. 2xx indicates success. So, the 250 blah blah blah, basically means that the email address is valid. Sorta anti-climatic? Maybe, but what’s the end result? You’ve just made sure that an email address is valid. Give yourself another pat on the back.

So, just in case you were wondering, I wrote this tutorial on Melissa’s MacBook. Thanks honey for volunteering your computer long enough for me to write this. Then again, you’re watching American Idol, so I doubt you need the computer right now. And, since this is a tech tutorial, I doubt you’ve read this far.

;)

One Response to “Check For Valid Email With Telnet”

  1. May 21 2008
    mom Says:

    or you could just pick up the phone and ask them…

Leave a Reply

Loading the background image. This will cache after the first load.