.msg to .eml file using Aspose.Email missing Calendar data - c#

I am trying to convert from .msg to .eml file format using Aspose.Email for .NET. Pretty trivial:
var msg = MapiMessage.FromFile(#"example.msg");
MailMessageInterpretor mmi = MailMessageInterpretorFactory.Instance.GetIntepretor(msg.MessageClass);
MailMessage eml = mmi.Interpret(msg);
eml.Save(#"example.eml");
If its a calendar invite, I see it in the .msg file and also in the .eml file, as shown below (.msg on top, .eml on the bottom):
It also includes the meeting .ics file within the .eml it produces:
Content-Type: text/calendar; method="REQUEST"; name="meeting.ics";
charset="utf-8" Content-Transfer-Encoding: base64
However, the problem is that if it is a meeting cancellation instead of an invitation:
The resulting .eml as you can see, does not include meeting details, nor does the resulting .eml contain any trace of a meeting .ics (which does exist in the .msg). I can parse the .msg for it easily:
MapiCalendar calendar = (MapiCalendar)msg.ToMapiMessageItem();
Why is it not base-64 encoding the .ics for cancellations in the resulting .eml? Am I doing something wrong? Is it an Aspose bug? Is it normal behavior? What's going on here?

Could you please share your input/output files with us on Aspose.Email forum? We need to understand what steps are you taking that gives raise to this issue and will further assist you in the forum. If we find it to be a bug with the API, we'll log it for investigation by our Product team.
I work with Aspose as Developer Evangelist.
Edit:
Please try mmi.InterpretAsTnef(msg). Though it should work with Interpret as well, but it seems an issue with the API. We're investigating the problem at our end, however, you can use the InterpretAsTnef meanwhile. You may register on www.Aspose.com free of cost. Our basic support is free for all whether it is paid or non-paid users.

Related

Manipulate and process email

I am using Thunderbird and I need to somehow manipulate and process the e-mails that are stored in inbox.msf file using C# language. In C# I am using SS2.Pop3 library.So, I was wondering, how do you parse an .msf file?
.msf files are mail summary files and do not contain emails (admittedly, it's been like 10 years since I looked). Thunderbird uses standard UNIX mbox formatted files to store mail.
There is only 1 parser for those files available in C# and that is MimeKit (which also happens to be my library).
I'm pretty sure that if you have an Inbox.msf file, right next to it should be a file called Inbox which has the actual mail in it. That's the file you want to parse.

Replace attachment in Outlook with zipped version possible?

Is it possible to create a .Net application which can read my Outlook mailbox, and for each mail replace any attachment with its compressed replacement?
In short, the .NET application/addin should check my old mails one by one, if it has an attachment file, then zip it, and replace the original attachment file with the new zipped one.
This is to reduce the size consumed in my mailbox. is there any such tool already available online?
I am using .Net 2008/2012 and Outlook 2010.
yes, there are a few components available to work with outlook, popular ones: Redemption, Outlook Interop
To achieve what you said, should be fairly simple, retrieve the email and do whatever you like and save it.
Question off the topic: zip the attachments could reduce your mail size, but it will still be large sooner or later... why not think about other ways, for example, archive your emails and etc.?
Could not find exactly what I need, so started creating one. Here is the attempt - http://www.saurabhkumar.com/autozip/ It compresses(zips) mail attachments, just before the mail is sent. Saves the sender and recipient lots of headache.

Parsing and extracting HTML and Text messages from raw .eml file

I did this before, but the source codes were in a flash memory which one failed. So I'm rewriting the project. I've got archived .eml files on disk and I need to extract HTML message if any. If not, I'll extract text message.
I don't remember what 3rd party used before. But parsing was so easy like below:
oMessage.Raw = LoadFile(fileEml);
msgHTML = oMessage.HTML;
msgText = oMessage.Text;
Can anyone recognize that 3rd party library?
I don't know what parsing library you were using before, but the best parser out there right now is MimeKit. It's significantly faster and more RFC-compliant than any other parser.
I'm also working on a mail client library (SMTP, POP3 and IMAP) called MailKit.
(Disclosure: I wrote MimeKit and MailKit after spending time looking at all of the Open Source alternatives out there and finding that all of them were really bad, and often the authors of said libraries blamed the other mail software when it was a bug in their own code and they would have realized that if they actually bothered to read the RFCs.)

Display a saved .msg message as HTML or ASP.NET

I have a problem. I need a way to import a saved .msg file from Outlook and then display this as html.
Ideally I would have an ASP:FileUpload control that the user would upload the email. Then I would want to parse this as markup so the email can be displayed in the website. I just don't know how to go about pulling this email message in and passing it as a new MailMessage object.
If I could bring the data from the file upload in as a new MailMessage object I would imagine I could read the information from the file and display this.
There has to be a way to display the contents of a .msg with C#. I can't imagine there isn't. I would REALLY like to not use third party plug-ins or .dll files. I have a feeling C# has this functionality somehow built into it. (maybe include one of the references?)
Have you considered using a third-party library to load the MSG file, and then retrieve the content of the message? Aspose.Email can probably do that for you.

How to convert a Word file content (with images and tables) into RFC 822 format using c#?

I want to read a Word file (contains images and table).
After that i want to convert it's content into "RFC 822 format ".
Looking for some APIS and sample code for above.
Start with the Open XML SDK 2.0 for Microsoft Office to read the Word file.
RFC 822 is not the specification you're looking for.
The abstract for RFC 5322 reveals one reason:
This document specifies the Internet Message Format (IMF), a syntax
for text messages that are sent between computer users, within the
framework of "electronic mail" messages. This specification is a
revision of Request For Comments (RFC) 2822, which itself superseded
Request For Comments (RFC) 822, "Standard for the Format of ARPA
Internet Text Messages", updating it to reflect current practice and
incorporating incremental changes that were specified in other RFCs.
This paragraph from section 1.1 ("Scope") reveals another:
This document specifies a syntax only for text messages. In
particular, it makes no provision for the transmission of images,
audio, or other sorts of structured data in electronic mail messages.
There are several extensions published, such as the MIME document
series ([RFC2045], [RFC2046], [RFC2049]), which describe mechanisms
for the transmission of such data through electronic mail, either by
extending the syntax provided here or by structuring such messages to
conform to this syntax. Those mechanisms are outside of the scope of
this specification.
I think that you actually want the answer to a different question, like:
How can I convert a Word message to a MIME-based format that will look nice in a variety of mail user-agents?
If I'm wrong, and you really are asking how to convert Word documents to plain text emails, you should probably take a look at antiword, a highly featureful tool for converting Word documents to plain text, PostScript, PDF, or docbook. (There's no indication that it can do anything with images when outputting plain text, though — yet, anyway.)

Categories

Resources