cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: testing for connectivity to the SMTP server using libcurl APIs

From: SM <sm_at_resistor.net>
Date: Thu, 22 Nov 2012 10:35:54 -0800

At 03:52 22-11-2012, Chandran, Naveen wrote:
>My presumption was that, after setting up the SMTP server URL (using
>CURLOPT_URL), attempting just a 'FROM' alone (using
>CURLOPT_MAIL_FROM) would suffice.
>However, doing so sort of causes the code to get stalled (and then,
>eventually time out), probably because the library is expecting the
>'RCPT' and/or 'DATA' values too, in order to round up on the easy_perform.

The "clean" way would be to:

  1. send HELO
  2. read
  3. send FROM
  4. read
  5. send QUIT
  6. read

The session on the server side will be terminated (no timeout).

Regards,
-sm

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-11-22