SMTP code: 503


I got this situation and I have no idea why it caused SMTP code 503...please help me.

This is what I tried to do.  I try to run my program and send warning email if a condition is satisfied.  But I cannot receive any warning emails so I use a lan analyzer to detect what's wrong...and I got this SMTP code 503.  What will cause this problem and how can I solve this problem.  My program runs fine with other Linux 9.0....not sure which setting in Linux I should modify...Any idea????


Who is Participating?
Sounds as if you have written a program that attempts to communicate directly with an SMTP server by opening a connection to port 25 on the server and speaking raw SMTP.

That's daft, in my opinion. Why bother writing your own SMTP routines, when you can invoke the "mail" or "mailx" programs and use someone else's implementation?
However, if you *must* send raw SMTP messages, you should probably take the time to read RFC821 ( ). A successful SMTP protocol session (*without authentication*) goes something like this:

client:  HELO  foo
server:  250 Hello
client : MAIL FROM: <>
server:  250  <>... Sender ok
client:  RCPT TO: <fred@bar.comt>
server:  250  <matt@bar.comt>... Recipient ok
client:  DATA
server:  354 Enter mail, end with "." on a line by itself
client:  Subject: Hi!
client:  This is a test mail
client:  .
server:  250  Message accepted for delivery
client:  QUIT
server:  221 Closing connection

Perhaps you are skipping the "HELO", "MAIL FROM:", "RCPT TO:" and "DATA" commands and trying to launch directly into sending the headers and body of an e-mail?

Hi xenia27,
You're not authenticating with your mail server, that's what that business is about. I don't know what program you are using, but your mail server is set to require authentication for all non-local smtp transfer it looks like. You may want to configure that program to authenticate when it sends mail or make your SMTP server not require authentication if requests are coming from your lan.

xenia27Author Commented:
how can I authenticate my program when it sends mail??  what should I do?  ^^
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

> Well, what are you doing exactly. Is your mail server on your network or are you using an ISP mail server or what? Also, did you write this program, is it a shell script or what?
xenia27Author Commented: mail server is on our network...
I write this program...and it's an executable program in C++...
So what should I do?
xenia27Author Commented:
By the way, why I got this error message, "Error: send HELO/EHLO first", which came with error 503??  
Well after seeing you are getting the EHLO/HELO first message I may have to agree with Matt. I would wonder how you are implementing the mail function in your program. Though are you having any problems sending mail using the server from other clients, not using your program?
xenia27Author Commented:
Sorry for taking this long...but I'm still waiting for the reply after I adding HELO in my program..However, I think this will work!  Thank you~~~
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.