Get Exception when listing messages

hi all

I use the latest version(v3.6.1.0) of Aspose.Network.

When I tried to write a program to retrieve emails using IMAP protocol from exchange server 2003(sp2), I got an exception.

my code is like:

client.SelectFolder(“INBOX”)
Dim messageInfos As Aspose.Network.Imap.ImapMessageInfoCollection
messageInfos = client.ListMessages()

Then exception occured in “messageInfos = client.ListMessages()”, the message is "Invalid E-Mail Address Format"

Thanks for your help!

Raymond

Hi,

Thank you very much for considering Aspose.Network.

I recommend you to please catch the exception and print the complete text of exception (by using exception.ToString()) and call stack (by using exception.StackTrace). Please post the text of exception and call stack. This will help us to narrow down the cause of the problem and we will be able to propose a solution as soon as possible.

Many Thanks & Kind Regards,

Ammad-ul-Haq
Support Developer,
Guangzhou Team
Contact Us
Aspose - The .NET and Java Component Publisher

Thanks for your advice!

I got the exception content as follow:

ex.ToString:

“System.FormatException: Invalid E-Mail Address Format
at Aspose.Network.Mime.x3bb1e9025dbf40f4.x25437dba01d1e3b4(String x4a3f0a05c02f235f, Char

xb25822984a90695b, Int32& x374ea4fe62468d0f, String& xf0d47d7698b4e263)
at Aspose.Network.Mime.x3bb1e9025dbf40f4.x2e577bdc8b34de50(String x4a3f0a05c02f235f,

String& x179bb663e71b1f59, String& xf0d47d7698b4e263)
at Aspose.Network.Mail.MailAddress…ctor(String address, String displayName)
at Aspose.Network.Imap.ImapMessageInfo.xf25a4ab13a0d748d(Object xda5bf54deb817e37)
at Aspose.Network.Imap.ImapMessageInfo.xae84735599e7b543(x45efdabe04b88d09

x668259e219742fe9)
at Aspose.Network.Imap.ImapMessageInfo.xd7a698e3cc0ac8d7(String xc15bd84e01929885, Object

x37cf7043760b312e, Boolean xaeb32f36f12443d3)
at Aspose.Network.Imap.ImapMessageInfoCollection.xd7a698e3cc0ac8d7(Int32

x78b0a0bc28459535, String xc15bd84e01929885, Object x37cf7043760b312e, Int32

xa942970cc8a85fd4)
at Aspose.Network.Imap.ImapClient.xaf1ad0f9514c0e91(ImapMessageInfoCollection

x8a0b266419f09a55, x0d5228de32e4575d xe13536703a5eff16, Int32 xa942970cc8a85fd4, UInt32

x49f7e52e813da01a, Encoding xff3edc9aa5f0523b)
at Aspose.Network.Imap.ImapClient.x35d4f75cf2668399(xc410cc399b92bb26 x35e272d3072c829f,

Int32 xa942970cc8a85fd4)
at Aspose.Network.Imap.ImapClient.ListMessages()
at IMapWindowsDemoVB.Form1.list_folders() in E:\Program

Files\Aspose\Aspose.Network\Samples\Imap\ImapWindowsFormDemo\VB.NET\Form1.vb:line 443
at IMapWindowsDemoVB.Form1.button_connect_Click(Object sender, EventArgs e) in E:\Program

Files\Aspose\Aspose.Network\Samples\Imap\ImapWindowsFormDemo\VB.NET\Form1.vb:line 392”


ex.StackTrace:

at Aspose.Network.Mime.x3bb1e9025dbf40f4.x25437dba01d1e3b4(String x4a3f0a05c02f235f, Char

xb25822984a90695b, Int32& x374ea4fe62468d0f, String& xf0d47d7698b4e263)
at Aspose.Network.Mime.x3bb1e9025dbf40f4.x2e577bdc8b34de50(String x4a3f0a05c02f235f,

String& x179bb663e71b1f59, String& xf0d47d7698b4e263)
at Aspose.Network.Mail.MailAddress…ctor(String address, String displayName)
at Aspose.Network.Imap.ImapMessageInfo.xf25a4ab13a0d748d(Object xda5bf54deb817e37)
at Aspose.Network.Imap.ImapMessageInfo.xae84735599e7b543(x45efdabe04b88d09

x668259e219742fe9)
at Aspose.Network.Imap.ImapMessageInfo.xd7a698e3cc0ac8d7(String xc15bd84e01929885, Object

x37cf7043760b312e, Boolean xaeb32f36f12443d3)
at Aspose.Network.Imap.ImapMessageInfoCollection.xd7a698e3cc0ac8d7(Int32

x78b0a0bc28459535, String xc15bd84e01929885, Object x37cf7043760b312e, Int32

xa942970cc8a85fd4)
at Aspose.Network.Imap.ImapClient.xaf1ad0f9514c0e91(ImapMessageInfoCollection

x8a0b266419f09a55, x0d5228de32e4575d xe13536703a5eff16, Int32 xa942970cc8a85fd4, UInt32

x49f7e52e813da01a, Encoding xff3edc9aa5f0523b)
at Aspose.Network.Imap.ImapClient.x35d4f75cf2668399(xc410cc399b92bb26 x35e272d3072c829f,

Int32 xa942970cc8a85fd4)
at Aspose.Network.Imap.ImapClient.ListMessages()
at IMapWindowsDemoVB.Form1.list_folders() in E:\Program

Files\Aspose\Aspose.Network\Samples\Imap\ImapWindowsFormDemo\VB.NET\Form1.vb:line 443
at IMapWindowsDemoVB.Form1.button_connect_Click(Object sender, EventArgs e) in E:\Program

Files\Aspose\Aspose.Network\Samples\Imap\ImapWindowsFormDemo\VB.NET\Form1.vb:line 392

Dear user,

Thank you for your patience. Our development team is solving this issue and solution will be posted as soon as it is available.


Hello,

Could you try this hotfix?

http://www.aspose.com/products/Aspose.Network/Releases/3.6.0/Aspose.Networkv3.6.3.zip

Let me know if it works.

Thanks

Hi

I used the hotfix and got a different exception this time:

ex.ToString:
System.FormatException: Invalid Format
at Aspose.Network.Mime.x3bb1e9025dbf40f4.x8b46e51034cef490(String x4a3f0a05c02f235f, Int32& x374ea4fe62468d0f, StringBuilder xd07ce4b74c5774a7)
at Aspose.Network.Mime.x3bb1e9025dbf40f4.x25437dba01d1e3b4(String x4a3f0a05c02f235f, Char xb25822984a90695b, Int32& x374ea4fe62468d0f, String& xf0d47d7698b4e263)
at Aspose.Network.Mime.x3bb1e9025dbf40f4.x2e577bdc8b34de50(String x4a3f0a05c02f235f, String& x179bb663e71b1f59, String& xf0d47d7698b4e263)
at Aspose.Network.Mail.MailAddress…ctor(String address, String displayName, Boolean ignoreValidate)
at Aspose.Network.Imap.ImapMessageInfo.xf25a4ab13a0d748d(Object xda5bf54deb817e37)
at Aspose.Network.Imap.ImapMessageInfo.xae84735599e7b543(x45efdabe04b88d09 x668259e219742fe9)
at Aspose.Network.Imap.ImapMessageInfo.xd7a698e3cc0ac8d7(String xc15bd84e01929885, Object x37cf7043760b312e, Boolean xaeb32f36f12443d3)
at Aspose.Network.Imap.ImapMessageInfoCollection.xd7a698e3cc0ac8d7(Int32 x78b0a0bc28459535, String xc15bd84e01929885, Object x37cf7043760b312e, Int32 xa942970cc8a85fd4)
at Aspose.Network.Imap.ImapClient.xaf1ad0f9514c0e91(ImapMessageInfoCollection x8a0b266419f09a55, x0d5228de32e4575d xe13536703a5eff16, Int32 xa942970cc8a85fd4, UInt32 x49f7e52e813da01a, Encoding xff3edc9aa5f0523b)
at Aspose.Network.Imap.ImapClient.x35d4f75cf2668399(xc410cc399b92bb26 x35e272d3072c829f, Int32 xa942970cc8a85fd4)
at Aspose.Network.Imap.ImapClient.ListMessages()
at IMapWindowsDemoVB.Form1.list_folders() in E:\Program Files\Aspose\Aspose.Network\Samples\Imap\ImapWindowsFormDemo\VB.NET\Form1.vb:line 443
at IMapWindowsDemoVB.Form1.button_connect_Click(Object sender, EventArgs e) in E:\Program Files\Aspose\Aspose.Network\Samples\Imap\ImapWindowsFormDemo\VB.NET\Form1.vb:line 392

ex.StackTrace
at Aspose.Network.Mime.x3bb1e9025dbf40f4.x8b46e51034cef490(String x4a3f0a05c02f235f, Int32& x374ea4fe62468d0f, StringBuilder xd07ce4b74c5774a7)
at Aspose.Network.Mime.x3bb1e9025dbf40f4.x25437dba01d1e3b4(String x4a3f0a05c02f235f, Char xb25822984a90695b, Int32& x374ea4fe62468d0f, String& xf0d47d7698b4e263)
at Aspose.Network.Mime.x3bb1e9025dbf40f4.x2e577bdc8b34de50(String x4a3f0a05c02f235f, String& x179bb663e71b1f59, String& xf0d47d7698b4e263)
at Aspose.Network.Mail.MailAddress…ctor(String address, String displayName, Boolean ignoreValidate)
at Aspose.Network.Imap.ImapMessageInfo.xf25a4ab13a0d748d(Object xda5bf54deb817e37)
at Aspose.Network.Imap.ImapMessageInfo.xae84735599e7b543(x45efdabe04b88d09 x668259e219742fe9)
at Aspose.Network.Imap.ImapMessageInfo.xd7a698e3cc0ac8d7(String xc15bd84e01929885, Object x37cf7043760b312e, Boolean xaeb32f36f12443d3)
at Aspose.Network.Imap.ImapMessageInfoCollection.xd7a698e3cc0ac8d7(Int32 x78b0a0bc28459535, String xc15bd84e01929885, Object x37cf7043760b312e, Int32 xa942970cc8a85fd4)
at Aspose.Network.Imap.ImapClient.xaf1ad0f9514c0e91(ImapMessageInfoCollection x8a0b266419f09a55, x0d5228de32e4575d xe13536703a5eff16, Int32 xa942970cc8a85fd4, UInt32 x49f7e52e813da01a, Encoding xff3edc9aa5f0523b)
at Aspose.Network.Imap.ImapClient.x35d4f75cf2668399(xc410cc399b92bb26 x35e272d3072c829f, Int32 xa942970cc8a85fd4)
at Aspose.Network.Imap.ImapClient.ListMessages()
at IMapWindowsDemoVB.Form1.list_folders() in E:\Program Files\Aspose\Aspose.Network\Samples\Imap\ImapWindowsFormDemo\VB.NET\Form1.vb:line 443
at IMapWindowsDemoVB.Form1.button_connect_Click(Object sender, EventArgs e) in E:\Program Files\Aspose\Aspose.Network\Samples\Imap\ImapWindowsFormDemo\VB.NET\Form1.vb:line 392" String

Hello,

It looks like we made a mistake in fixing this bug. I have added a debug information in the hotfix, could you please run it again. Print the exception out.

I try to catch the error in the parsing. It may be caused by some special email address. Please download the dll for your usage.

http://www.aspose.com/products/Aspose.Network/Releases/3.6.0/Aspose.Networkv3.6.3.zip

Thank you very much.

Hi

The following is the debug info:

ex.ToString “System.FormatException: debugging informatin:

address:Telestar Online <online,domaintelestar.com.au,displayName:Telestar Online Ordering

and Tracking
at Aspose.Network.Imap.ImapMessageInfo.xf25a4ab13a0d748d(Object xda5bf54deb817e37)
at Aspose.Network.Imap.ImapMessageInfo.xae84735599e7b543(x45efdabe04b88d09

x668259e219742fe9)
at Aspose.Network.Imap.ImapMessageInfo.xd7a698e3cc0ac8d7(String xc15bd84e01929885, Object

x37cf7043760b312e, Boolean xaeb32f36f12443d3)
at Aspose.Network.Imap.ImapMessageInfoCollection.xd7a698e3cc0ac8d7(Int32

x78b0a0bc28459535, String xc15bd84e01929885, Object x37cf7043760b312e, Int32

xa942970cc8a85fd4)
at Aspose.Network.Imap.ImapClient.xaf1ad0f9514c0e91(ImapMessageInfoCollection

x8a0b266419f09a55, x0d5228de32e4575d xe13536703a5eff16, Int32 xa942970cc8a85fd4, UInt32

x49f7e52e813da01a, Encoding xff3edc9aa5f0523b)
at Aspose.Network.Imap.ImapClient.x35d4f75cf2668399(xc410cc399b92bb26 x35e272d3072c829f,

Int32 xa942970cc8a85fd4)
at Aspose.Network.Imap.ImapClient.ListMessages()
at IMapWindowsDemoVB.Form1.list_folders() in E:\Program

Files\Aspose\Aspose.Network\Samples\Imap\ImapWindowsFormDemo\VB.NET\Form1.vb:line 443
at IMapWindowsDemoVB.Form1.button_connect_Click(Object sender, EventArgs e) in E:\Program

Files\Aspose\Aspose.Network\Samples\Imap\ImapWindowsFormDemo\VB.NET\Form1.vb:line 392”

String





ex.StackTrace " at

Aspose.Network.Imap.ImapMessageInfo.xf25a4ab13a0d748d(Object xda5bf54deb817e37)
at Aspose.Network.Imap.ImapMessageInfo.xae84735599e7b543(x45efdabe04b88d09

x668259e219742fe9)
at Aspose.Network.Imap.ImapMessageInfo.xd7a698e3cc0ac8d7(String xc15bd84e01929885, Object

x37cf7043760b312e, Boolean xaeb32f36f12443d3)
at Aspose.Network.Imap.ImapMessageInfoCollection.xd7a698e3cc0ac8d7(Int32

x78b0a0bc28459535, String xc15bd84e01929885, Object x37cf7043760b312e, Int32

xa942970cc8a85fd4)
at Aspose.Network.Imap.ImapClient.xaf1ad0f9514c0e91(ImapMessageInfoCollection

x8a0b266419f09a55, x0d5228de32e4575d xe13536703a5eff16, Int32 xa942970cc8a85fd4, UInt32

x49f7e52e813da01a, Encoding xff3edc9aa5f0523b)
at Aspose.Network.Imap.ImapClient.x35d4f75cf2668399(xc410cc399b92bb26 x35e272d3072c829f,

Int32 xa942970cc8a85fd4)
at Aspose.Network.Imap.ImapClient.ListMessages()
at IMapWindowsDemoVB.Form1.list_folders() in E:\Program

Files\Aspose\Aspose.Network\Samples\Imap\ImapWindowsFormDemo\VB.NET\Form1.vb:line 443
at IMapWindowsDemoVB.Form1.button_connect_Click(Object sender, EventArgs e) in E:\Program

Files\Aspose\Aspose.Network\Samples\Imap\ImapWindowsFormDemo\VB.NET\Form1.vb:line 392"

String



Thanks

Hello, It looks like the email file contains some invalid format Email address,

like Telestar Online ). I will try to fix it.

Thanks so much.

Hi Iret

Thanks for your reply. Just wondering when you can fix this.


Raymond

Could you give it another try?

http://www.aspose.com/products/Aspose.Network/Releases/3.6.0/Aspose.Networkv3.6.3.zip

We depress the exception in this hotfix. We will fix it completly in the coming release by adding fail-recover parsing.

Thanks,

Hi Iret

Thanks a lot! it works.

Raymond

Hi Iret

Would you please give me .net 1.1 version of aspose.network v3.6.3, because I need to use it in a .net 1.1. program as well.

Thanks a lot!

Raymond

Hello, Raymond,

We will release an official build shortly which will contain 1.1 and 2.0 dlls. I will keep you posted

Best regards.

Thanks Iret!