cURL / Mailing Lists / curl-library / Single Mail

curl-library

[PATCH] SMTP: Added support for returning SMTP response codes

From: Steve Holme <steve_holme_at_hotmail.com>
Date: Wed, 22 Feb 2012 15:34:39 +0000

Hi Daniel,

 

Please find attached a patch for returning the SMTP response code via the
Curl_getinfo() function.

 

This extends the functionality of the CURLINFO_RESPONSE_CODE action to
include SMTP in addition to the currently supported HTTP and FTP response
codes by setting conn->data->info.httpcode in smtp.c. Generally speaking if
a SMTP send succeeds then Curl_getinfo() will return 250 in the output
value. If an error was to occur, for example, "mail from" contained an
invalid email address then 501 would be returned in the output value, whilst
an email that is rejected by the server because too many emails have been
previous sent might cause 421 to be returned here.

 

I have also updated the docs accordingly as well.

 

Kind Regards

Steve

Received on 2012-02-22