What does LastStatus 221 mean?

Created  2001-06-18 by Rainer Gerhards.

I am sending email via SimpleMail. When I check the LastStatus property after sending mail, I do see an 221 status. Also, my mail is stuck in my outbound server (I see it in its queue). What causes this error?

First of all some clearification: the 221 status is not an error - it is the indication that all went well. The LastStatus is only an error if the SendEx() function fails (a -1 return code). It is the actual SMTP return status, and 221 means successful message delivery. Successful delivery is also confirmed because the messages can be seen in the mail server's queue. If SimpleMail had failed for some reason, they won't be in there.

SimpleMail works as follows: it creates the mails based on the supplied parameters. Then, it send these to the relay server (the one specified in the SMTPSever property). This server queues the mail and is then responsible for delivery to the final destination (or yet another relay server, but this is irrelevant to SimpleMail). As far as SimpleMail is concerned, the mail has been delivered once it reaches the relay server. Please note that this is the behavior of all mail clients and applications.

To diagnose the problem, you need to check the configuration of the relay email server. Make sure it is able to relay the mail to the final destination. Please see the server administrator for further help.

Also, please keep in mind that the return state of the SendEx() method should be verified. The LastStatus property does contain an error code only if SendEx() returns -1.

 

Back to Non-Printer Version