Hello,

I am testing out the Pop3 Mail component to see if we want to replace our existing Pop3 Mail component. Our current component locks up after a while and is not robust enough for our use.

Our process is as follows:

  1. Emails are journaled to a specific pop3 email account as an attachement.
  2. I developed a service that will monitor the account for new emails and verify that the attachment is a mail message by checking the attachements DisplayName.
  3. attachement is saved to a memorystream and reloaded as another MailMessage, which is then processed into the database.

When I call the MailMessage.Load(stream) I get the following error message: Unable to parse mail message, headers end with an invalid line.

If I save the attachment as a file with the extension .eml and call MailMessage.Load with the filepath it loads fine.

Could you please let me know if there is a known issue with loading a memorystream? I'd prefer to not save the files to the disk as this process will operate on 2000 - 3000 emails daily. This issue is repeatable on every email I tried to load from a stream.

Thanks,

Don Tompkins

asked 26 Apr '11, 15:21

DonTompkins's gravatar image

DonTompkins
271
accept rate: 0%


This error typically arises when the stream pointer is at the End of stream (so reading from the stream returns nothing).

Please ensure the stream.Position = 0 before you call the mail.Load(stream) method.

link

answered 26 Apr '11, 16:29

Lukas%20Matyska's gravatar image

Lukas Matyska ♦♦
90117
accept rate: 28%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×53
×36

Asked: 26 Apr '11, 15:21

Seen: 774 times

Last updated: 26 Apr '11, 16:29