Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am developing some software using Ruby on Rails in Ubuntu. I added Ruby's native mailer library, but it isn't sending mails so I want to make sure that my OS is not prohibiting that.

How can I test the ability of my OS to send email?

I got this system output:

telnet mx0.gmx.com 25
Connected to mx0.gmx.com.
Escape character is '^]'.
220 mx0.gmx.com GMX Mailservices ESMTP {mx-us011}
250-mx0.gmx.com GMX Mailservices
250 SIZE
share|improve this question
Any computer with a network connection can send mail (if your ISP allows it). Without knowing how Ruby's native mailer library works, it's fairly impossible to answer this question. –  Hyppy May 26 '11 at 17:03
@Hyppy I had in mind the case of maybe being behind a firewall, or having some other security restrictions, or installation quirks. –  Genadinik May 26 '11 at 17:05
telnet server.com 25 to a valid mail server ... at the prompt type "EHLO". If you get a response, you're good. –  Hyppy May 26 '11 at 17:06
@Hyppy I did this on my own system: "telnet localhost 25" and here is what I got: Trying ::1... Trying telnet: Unable to connect to remote host: Connection refused - what does that mean? Did I do something wrong? –  Genadinik May 26 '11 at 17:10
@Hyppy: make that an answer. –  Ward May 26 '11 at 17:10

1 Answer 1

up vote 4 down vote accepted

Use the following command to connect to a valid mail server:

telnet server.com 25

At the prompt type "EHLO". If you get a response, you're good.

share|improve this answer
@Genadinik: the response you posted shows that your system can connect to an external mail server, so there's nothing on your system or between you and that external mail server that's stopping your mail. Therefore, it's a problem with your software. QED –  Ward May 26 '11 at 17:28
I'll vote up once the new day rolls around in UTC... –  Ward May 26 '11 at 17:28
and @Ward Thank you :) –  Genadinik May 26 '11 at 17:54
He still could get his mail rejected after EHLO, e.g. if his server IP is blacklisted or something. –  AlexD May 27 '11 at 9:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.