Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 1591

Show
Ignore:
Timestamp:
02/03/07 11:41:56 (2 years ago)
Author:
qbert
Message:

Added methods for extracting fields and the body of the message

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/patches/proposals/Pop3Client.d

    r1383 r1591  
    261261        for ( int i = 0 ; i < count; i++ ) 
    262262        { 
    263             Stdout.formatln("Message Number {0}: {1}",toUtf8(i),pop3.retr(i+1).resp)().newline; 
     263          POP3Response resp = pop3.retr(i+1); 
     264           
     265          char [] to = extractField("To:",resp ); 
     266          char [] subject = extractField("Subject:",resp ); 
     267          char [] from = extractField("From:",resp ); 
     268          char [] returnPath = extractField("Return-Path:",resp ); 
     269          char [] msg = extractBody(resp); 
     270 
     271          Stdout.formatln("To: {0}\nFrom:{1}\nSubject: {2}\nReturnPath: {3}\n[{4}]",to,from,subject,returnPath,msg)().newline; 
    264272 
    265273