Re: Using SMTP Server in C#

Giganews Newsgroups
Subject: Re: Using SMTP Server in C#
Posted by:  Remy Lebeau (TeamB) (
Date: Tue, 28 Sep 2004

"Joe Henrich" <joe.henri…> wrote in message

> So, noticing that the DoRun() returns a bool,  I put it into
> a while loop such as while(AContext.DoRun());

You should never call DoRun() directly.  In fact, DoRun() is obsolete
anyway, it is not used anymore.

> This seemed to keep the connection alive, but, now, I keep getting
> "501 2.0.0 Invalid Syntax" on my "MAIL FROM:<joe.henri…>"
> command.

There is a missing space between the ":" and "<" characters.

> Or, for any valid command for that matter.

The only way that error can occur is if your commands are not actually

> If I send garbage commands (like "aaa" or "bbb"), the server
> echos them back to me.

The server should be echoing them back with error codes attached to them.



In response to

Using SMTP Server in C# posted by Joe Henrich on Tue, 28 Sep 2004