Click here to Skip to main content
15,888,006 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello Folks,

I have implemented a transport agent to convert all the HTML messages to plain text, the transport agent works fine with all external messages, where i convert the body and change the content type through the MIME part.


but with the internal messages its not working fine, i do the conversion for the body but when i receive the mail it is only the text all together like one paragraph without the basic formatting at least the new lines.


i think this is related for not changing the content type in the Message format -(TNEF format), but is it possible to change the content type in the TNEF format? i couldn't find any example about this! there is the TNEF readers and writers but without a helpful example!


there is no MIME Part in the internal messages, just TNEF part. i don't know if it is possible to to convert the TNEF to MIME and do the conversion there? or is there a way to fix how the body will looks like with the basic formatting - maybe changing the content type in TNEF format or in a layer that i don't need to work with the TNEF and MIME formats?

I tried to change in the MIME document direct but i am always getting a null reference on the relay function after the execution of the transport agent!


so if there is another approaches that i need to check it, please advise?


Thanks in advance,

Jamil Isayyed
Posted
Comments
Sergey Alexandrovich Kryukov 30-Apr-15 10:30am    
Why converting anything to plain text? All messages, technically, already plain text, but some parts could be represented using base64. What do you want to do with, say, images? And why?
—SA
Jamil Isayyed 30-Apr-15 12:11pm    
there is different formats for the mail such as RTF, HTML...etc. where it is structured using the MIME format if it is from external emails or TNEF format if it is from internal emails in exchange or outlook.

what i want to do is to convert all my mails to plain text with text format wither its internal or external emails and i want to attach the original format in a pdf.
Sergey Alexandrovich Kryukov 30-Apr-15 14:50pm    
There are not format for the mail. With equal success, all kind of trash can be a "format for mail", say, ZIP or *.DLL. Are you ignoring them? Anyway, you have to interpret data as text, not just change MIME part of headers. Say, PDF is not text...
—SA
Jamil Isayyed 4-May-15 3:00am    
well, i already have the proper handling for the attachments and these types of data in an email. i am talking about the format of the email body which doesn't contain the attachment...etc.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900