Here's an example session with the finished program:
What is the name of the mailbox? tempMailbox 1 aqudu@ungulates.com Re: toys 2 dmusican@mathcs.carleton.edu [Bowling] Sub tonite? 3 asdf@carleton.edu Re: images in classes 4 fleen@carleton.edu Re: assignment View message (m) or reply (r)? m Which message do you want to view? 1 Return-Path:Received: from caesar.acns.carleton.edu (Caesar.ACNS.Carleton.edu [137.22.1.26]) by mathcs.carleton.edu (8.9.3/8.9.3) with ESMTP id KAA15967 for ; Wed, 24 Jan 2001 10:23:04 -0600 Received: from mail.ungulates.com ([208.42.17.1]) by carleton.edu (PMDF V5.2-32 #36754) with SMTP id <0G7O0039RANI9S@carleton.edu> for jondich@mathcs.carleton.edu (ORCPT rfc822;jondich@carleton.edu); Wed, 24 Jan 2001 09:21:19 -0600 (CST) Received: from RBDOMAIN-Message_Server by mail.ungulates.com with Novell_GroupWise; Wed, 24 Jan 2001 09:22:22 -0600 Date: Wed, 24 Jan 2001 09:22:06 -0600 From: Andrew Qudu Subject: Re: toys To: jondich@carleton.edu Message-id: MIME-version: 1.0 X-Mailer: Novell GroupWise 5.5.2 Content-type: text/plain; charset=US-ASCII Content-disposition: inline Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mathcs.carleton.edu id KAA15967 Fortunately, Talia has not noticed the missing airplane yet. Maybe you could mail it to us? 1 aqudu@ungulates.com Re: toys 2 dmoosica@mathcs.carleton.edu [Bowling] Sub tonite? 3 asdf@carleton.edu Re: images in classes 4 fleen@carleton.edu Re: assignment View message (m) or reply (r)? r To which message would you like to reply? 1 [Type your message. To end the message, type a line consisting of only a period.] Andy, We'll mail it to you once we're done playing with it. Jeff . [Message sent.]
while( getline(inputFile,s) && s != "." ) { // Sorry--you'll need to figure out this part // yourself. }
string reply; // ... in here, assemble the reply. See previous item. // Now put the reply into a file ofstream outputFile( "tempFile.txt" ); if( !outputFile.is_open() ) { cout << "Can't open tempFile.txt. I'm outta here." << endl; exit( 1 ); } outputFile << reply; outputFile.close();
mail destinationaddressgoeshere < tempFile.txt rm tempFile.txt
Have fun, start early, and keep in touch.