| Author |  | 
      
        | scotty Newbie
 
  
 
 Joined: 27 August 2007
 Online Status: Offline
 Posts: 25
 | 
          After loading or downloading a message that contains the following lines in the header
           | Posted: 08 November 2012 at 12:52am | IP Logged |   |  
           | 
 |  
 Content-Type: application/pkcs7-mime; smime-type=signed-data;
 name="smime.p7m"
 
 and accessing the MailMessage.Cc-Collection, calls to GetMessageRawData() and SaveMessage() fail with a NullReference-Exception.
 
 The following sample code demonstrates the problem:
 
 
 
| Code: 
 
    
    | 
      
       | static void Main(string[] args)
 {
 MailBee.Global.LicenseKey = "xxx";
 
 string text =
 "From: Sally Test <sally.test@one.org>\r\n" +
 "To: \"pt@two.net\" <pt@two.net>\r\n" +
 "Subject: Testing...\r\n" +
 "Message-ID: <01262F008F@three.com>\r\n" +
 "Content-Type: application/pkcs7-mime; smime-type=signed-data;\r\n" +
 "   name=\"smime.p7m\"\r\n" +
 "Content-Disposition: attachment; filename=\"smime.p7m\"\r\n" +
 "Content-Transfer-Encoding: base64" +
 "MIME-Version: 1.0\r\n\r\n" +
 "MIAGCSqGSIb3DQEHAqCAMIACAQEwYXNzaWVydCBzZWluIEogSWNoIxCzAJBgUrDgMCGgUAMIAGCS\r\n" +
 "ywAAAAAAAA==\r\n";
 
 MailMessage msg = new MailMessage();
 msg.LoadMessage(new MemoryStream(System.Text.UTF8Encoding.UTF8.GetBytes(text)));
 byte[] bytes = msg.GetMessageRawData(); // works fine
 EmailAddressCollection coll = msg.Cc;
 bytes = msg.GetMessageRawData();    // fails with NullReference-Exception.
 
 }
 
 |  |  |  I could save the message before accessing MailMessage.Cc but that would complicate things in my application enormously
  . Is there something i can do to avoid this behavior?
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6168
 | 
          Can you confirm the problem persists with current DLL version 7.2.2.379? It's available for download here.
           | Posted: 08 November 2012 at 12:58am | IP Logged |   |  
           | 
 |  
 --
 Regards,
 Igor, AfterLogic Support
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | scotty Newbie
 
  
 
 Joined: 27 August 2007
 Online Status: Offline
 Posts: 25
 | 
          I downloaded the version and was able to reproduce the issue. The problem still persists in version 7.2.2.379.
           | Posted: 08 November 2012 at 7:31am | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6168
 | 
          OK, I've asked the developers to check this. Will get back to you once there are news.
           | Posted: 09 November 2012 at 1:03am | IP Logged |   |  
           | 
 |  
 --
 Regards,
 Igor, AfterLogic Support
 | 
       
        | Back to Top |     | 
       
       
        |  |