Archived Forum Post

Index of archived forum posts


SendEmail Returns Success, but Recipient Never Receives Email

May 07 '15 at 06:49

I've had cases were SendEmail returns success, but the recipient never receives the email.


Your program connects to an SMTP server to send email. It is the SMTP client.
This is what the SMTP conversation looks like (S = server, C = client)

  S: 220 Simple Mail Transfer Service Ready
  S: greets
  S: 250-8BITMIME
  S: 250-SIZE
  S: 250-DSN
  S: 250 HELP
  S: 250 OK
  C: RCPT TO:<>
  S: 250 OK
  S: 354 Start mail input; end with <crlf>.<crlf>
  C: Blah blah blah...
  C: ...etc. etc. etc.
  C: .
  S: 250 OK
  S: 221 Service closing transmission channel
The "handoff" to the SMTP server is completed at the final "250 OK". At this point, the SMTP client-to-server transaction has been completed, and delivery is now in the hands of the SMTP server. Any problems occuring after the handoff are unknown to the SMTP client.

One common issue is that some SMTP servers will not actually initiate delivery until the connection is closed. Chilkat will by default keep the connection open to the SMTP server so that a subsequent call to SendEmail may use the already open and authenticated connection. An application may call mailman.CloseSmtpConnection to explicitly send the QUIT command, receive its response, and then cleanly disconnect from the SMTP server.