Send e-mail with telnet

By Nisse Pettersson at January 18, 2010 06:05
Filed Under: Technical
Share on Facebook

For troubbleshooting it could come in handy to send an e-mail with telnet. It's easy as pie.

Start with running telnet and connecting to a smtp-server.

telnet smtp.microsoft.com 25

Then you get some text back "220 ESMTP". You need to present yourself to the server. You need to give the server the domain of the email adress you are using as a sender.

HELO nissesblog.se

Start typing your from email

MAIL FROM:nisse@nissesblog.se

then the recipient.

RCPT TO:bill.gates@microsoft.com

Now we need to add som text to the message. you can also add a subject.

DATA
Hey Bill, could I have some of your money?
.
// note the single dot, it's needed to tell the server that this is the end of the message

Then all you need to do is to leave with:

QUIT