Reading email using .net and Imap.

stoymigo

Senior Member
Joined
Dec 11, 2008
Messages
975
Reaction score
26
Hi, I'm working on a windows service that reads email data into a database.
The reference used is activeup.net.mail.

I send test emails from my outlook, but when reading the emails the body of the email is not the same
than originally sent.

What happens is some lines break, lines of text that would span around 70 characters.
Any idea whether it's the server that I send the email to that breaks the longer lines?
 
You are probably sending our HTML formatted mail and expecting a Text based result. So change the Outlook Mail Setting to Text Only and try again.
 
I tried resending the same email in plaintext format an realized that it stays in the same format which is what I want, but currently
I'm sending the email through html format.
 
Indeed mail is usually in 1 of 3 formats,
HTML
Rich
Plain

Should you wish to read any of these you'd have to create a parser that could read the information if it isn't plaintext
 
You are probably sending our HTML formatted mail and expecting a Text based result. So change the Outlook Mail Setting to Text Only and try again.

You were quicker than me, problem is these emails will get generated from html. Trying to look for a workaround
 
Oh there's also 1 extra possible complication,if mail gets sent from Microsoft exchange to Microsoft exchange the mail might get converted to a mime attachment ( read up on winmail.dat )
 
Either the client will have to change their format or I'll have to change the code to read from next line, and spend extra time to make sure it doesn't mess up the importing of the other different formats.
Thanks all.
 
The creators of activeup.net.mail or whatever has to have an option/flag that indicates the format the mail comes in and have the correct parser associated with it.

Otherwise find something else to read the mails for you, there's plenty of free code available, I personally use a mail component written in c# that I customize as I need
 
Hi There,
Back when I usesd to write code in the year .BI (Before Internet) you would have written your own code to solve this issue.
I did a bit of googling for you and found this that you could use to pillage the bits you don't want and save the bits that you do. I have not tried it so treat it a untested code.
This one here may also help you.
The key words I used on the google search were "mail parser code"

Good luck

Tim
 
Hi There,
Back when I usesd to write code in the year .BI (Before Internet) you would have written your own code to solve this issue.
I did a bit of googling for you and found this that you could use to pillage the bits you don't want and save the bits that you do. I have not tried it so treat it a untested code.
This one here may also help you.
The key words I used on the google search were "mail parser code"

Good luck

Tim

Unfortunately he's not doing it in perl, and as I mentioned, there's already open source .NET stuff that does exactly what he needs. If this component can't parse or even tell him if the email is html or not, then he needs to drop it and move onto something that does. www.codeproject.com is full of open source stuff including very detailed explanations
 
Top
Sign up to the MyBroadband newsletter
X