Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET Objects

 AfterLogic Forum : MailBee.NET Objects
Subject Topic: Problem with MailMessage.GetMessageRawDat Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
scotty
Newbie
Newbie


Joined: 27 August 2007
Online Status: Offline
Posts: 25
Posted: 08 November 2012 at 12:52am | IP Logged Quote scotty

After loading or downloading a message that contains the following lines in the header

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 View scotty's Profile Search for other posts by scotty
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6092
Posted: 08 November 2012 at 12:58am | IP Logged Quote Igor

Can you confirm the problem persists with current DLL version 7.2.2.379? It's available for download here.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
scotty
Newbie
Newbie


Joined: 27 August 2007
Online Status: Offline
Posts: 25
Posted: 08 November 2012 at 7:31am | IP Logged Quote scotty

I downloaded the version and was able to reproduce the issue. The problem still persists in version 7.2.2.379.
Back to Top View scotty's Profile Search for other posts by scotty
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6092
Posted: 09 November 2012 at 1:03am | IP Logged Quote Igor

OK, I've asked the developers to check this. Will get back to you once there are news.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide