Hi Steve,

Thanks for the advice. 
You noted that the CURLOPT_CONNECT_ONLY option would actually log into the SMTP 
server (if the auth details were to be supplied) and I hope to achieve exactly 
this for my testing  :)

However, on attempting the test code again with the CURLOPT_CONNECT_ONLY option 
added, after the initial SMTP server greeting, the code errors out as follows:

.
.
< 250-XUSR
< 250 HELP
< 500 Command unrecognized: ""
* Connection #0 to host xx.xx.xx.xx left intact
* Failure when receiving data from the peer
curl_easy_perform() failed: Failure when receiving data from the peer
> QUIT
< 500 Command unrecognized: "."
* Closing connection #0

Also, the libcurl man page mentions the CURLOPT_CONNECT_ONLY option as being 
applicable only to HTTP URLs. 
My apologies if I happen to have missed out on something very rudimentary.

Thanks,
Naveen

-----Original Message-----
From: curl-library [mailto:[email protected]] On Behalf Of 
Steve Holme
Sent: Thursday, November 22, 2012 6:06 PM
To: 'libcurl development'
Subject: RE: testing for connectivity to the SMTP server using libcurl APIs

Hi Naveen,

> Please let me know if there is a way to test for proper SMTP server 
> connectivity using libcurl 'without actually sending an email'.

You can do this with the CURLOPT_CONNECT_ONLY option and setting it to 1.

> Although this could otherwise be done with a simple telnet EHLO (or 
> HELO), I would like to know if it can be accomplished using the 
> libcurl API(s).

Please note that the connect only option will also log into the SMTP server 
after the EHLO if you supply authentication details.

Kind Regards

Steve

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to