logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

LineSizeExceededException when ParsingFile
t.kehl
#1 Posted : Friday, January 27, 2012 2:03:48 AM(UTC)
Rank: Newbie

Groups: Member
Joined: 1/26/2012(UTC)
Posts: 5
Points: 15
Location: Switzerland

Hi.
I try to create a MailMessage on the fallowing way:

var message = Mail_Message.ParseFromFile("c:\\temp\\aaa.mht");

but this give me always a LineSizeExceededException.

There is a image inside the file which is coded on one line which has length of 57385 characters, when I open it in an editor.
Can someone give me a hint, what I have to do that I can import this file?

Thank you very much.

Best Regards, Thomas
ivx
#2 Posted : Friday, January 27, 2012 8:58:35 AM(UTC)
Rank: Administration

Groups: Administration
Joined: 9/15/2006(UTC)
Posts: 1,867
Points: 5,474
Man
Location: Estonia

Was thanked: 60 time(s) in 60 post(s)
Hi,

Are you shore .mht contains mime formated message ?

Per MIME specification, message line cant be longer 76 chars, it must be folded then.
I support 32000 long lines for parsing and for saving i stick to 76 chars rule.
t.kehl
#3 Posted : Friday, January 27, 2012 10:01:06 AM(UTC)
Rank: Newbie

Groups: Member
Joined: 1/26/2012(UTC)
Posts: 5
Points: 15
Location: Switzerland

Hi
Can I reformat the file myself and insert line-breaks after 76 characters? - Or will this make the file invalid?
Thank you.
Thomas
ivx
#4 Posted : Friday, January 27, 2012 10:52:10 AM(UTC)
Rank: Administration

Groups: Administration
Joined: 9/15/2006(UTC)
Posts: 1,867
Points: 5,474
Man
Location: Estonia

Was thanked: 60 time(s) in 60 post(s)

Breaking lines is encoding dependan't, so thats not so easy.

I doubt that you have valid email message, all email clients compose vaild messages.
t.kehl
#5 Posted : Friday, January 27, 2012 11:09:51 AM(UTC)
Rank: Newbie

Groups: Member
Joined: 1/26/2012(UTC)
Posts: 5
Points: 15
Location: Switzerland

Hi

I have an Editor where the user can write Mail's. He can insert images and so on. They are saved from this editor in MHT-Format. After that, I use AfterLogic MailBee to send the mailmessages. This will work great with all of the created MHT-Files. I think, MailBee will reformat the MHT.
Now, I have to create an IMAP-Server, that the user can connect to it and get his messages out of the database to the IMAP-Client (only showing the stored messages).

I wrote, that you support 32000 long lines for parsing and save it with 76 chars rule. Can you point me to a peace of code - perhaps I can this reuse to convert my mht-files to lines with 76 chars?

Thanks.
Thomas
t.kehl
#6 Posted : Friday, January 27, 2012 1:01:55 PM(UTC)
Rank: Newbie

Groups: Member
Joined: 1/26/2012(UTC)
Posts: 5
Points: 15
Location: Switzerland

Hi

I have found a way, that I can transform the message in valid MIME-Format with MailBee.

Thomas
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF 1.9.5.5 | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.045 seconds.