cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Any POP3/SMTP examplse using libcurl is expected.

From: Dirk Manske <dm_at_nonitor.de>
Date: Fri, 20 Aug 2010 10:27:43 +0200

On Friday 20 August 2010 04:06:52 HeJin wrote:
> Yesterday, I connected to my pop3 server and even sent my username and password to.
>
> Here comes that I can use pop3://pop3.testserver.com.cn/mailid to get the mail with the mailid in my mailbox, but how can I get more than one mail?
>
I would guess, simply do another fetch with a different mailid in the
URL. Curl should reuse the prior connection.

> Can someone tell me that how to sent the RETR commond, which interface in /curl/curl.h is for RETR?
Curl sends magically the RETR command.

You can test this will s.t. like that:

curl -v -u 'user:pw' 'pop3://user@pop.gmx.net/1' 'pop3://user@pop.gmx.net/2'

* About to connect() to pop.gmx.net port 110 (#0)
* Trying 212.227.17.185... connected
* Connected to pop.gmx.net (212.227.17.185) port 110 (#0)
< +OK POP server ready H migmx001
> USER XXXXXXXX_at_gmx.net
< +OK password required for user "XXXXXXXXXX_at_gmx.net"
> PASS XXXXXXXXXXXXX
< +OK mailbox "XXXXXXXXXX_at_gmx.net" has 2 messages (2423 octets) H migmx001
> RETR 1
< +OK
...
* Connection #0 to host pop.gmx.net left intact
* Re-using existing connection! (#0) with host pop.gmx.net
* Connected to pop.gmx.net (212.227.17.185) port 110 (#0)
> RETR 2
< +OK
...
* Connection #0 to host pop.gmx.net left intact
> QUIT
< +OK POP server signing off
* Closing connection #0

So, curl works as expected.

Greetings,
Dirk
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-08-20