Creating a MimeReport

aspNetMime has the capability of creating a report from MimeMessages. This report can be used to condense information found in a POP3 mailbox. The following code example demonstrates creating a MimeReport.


//create a POP3 object from the .config file POP3 p = new POP3( true, false ); //create a new report MimeReport report = new MimeReport( true, true ); p.Connect(); int messageCount = p.MessageCount(); for( int i=0;i<messageCount;i++) { MimeMessage m = p.GetMessage( i ); //add the MimeMessage to the report report.AddToReport( m ); } p.Disconnect(); //save the report report.SaveToFile( "c:\\report.csv", MimeReportType.ValueSeparated );


'create a POP3 object from the .config file Dim p As New POP3(True, False) 'create a new report Dim report As New MimeReport(True, True) p.Connect() Dim messageCount As Integer = p.MessageCount() Dim i As Integer For i = 0 To messageCount - 1 Dim m As MimeMessage = p.GetMessage(i) 'add the MimeMessage to the report report.AddToReport(m) Next i p.Disconnect() 'save the report report.SaveToFile("c:\report.csv", MimeReportType.ValueSeparated)