You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes it is necessary to know some metadata of the email message, loaded to the [`Viewer`](https://reference.groupdocs.com/viewer/net/groupdocs.viewer/viewer/) class, before its actual rendering through the [`Viewer.View()`](https://reference.groupdocs.com/viewer/net/groupdocs.viewer/viewer/view/#view) method. GroupDocs.Viewer for such cases provides the [`ViewInfo`](https://reference.groupdocs.com/viewer/net/groupdocs.viewer.results/viewinfo/) class that can be obtained by calling a [`Viewer.GetViewInfo()`](https://reference.groupdocs.com/viewer/net/groupdocs.viewer/viewer/getviewinfo/#getviewinfo) method. However, this [`ViewInfo`](https://reference.groupdocs.com/viewer/net/groupdocs.viewer.results/viewinfo/) class is common for all supported document formats and has no specific properties, which are present only in the mail messages.
433
+
434
+
Starting from the version 26.1 the GroupDocs.Viewer public API has a new class [`MailMessageViewInfo`](https://reference.groupdocs.com/viewer/net/groupdocs.viewer.results/mailmessageviewinfo/). This class is a direct inheritor of the common class [`ViewInfo`](https://reference.groupdocs.com/viewer/net/groupdocs.viewer.results/viewinfo/), so it has all its properties, but also introduce the few new ones, specific for the mail messages:
435
+
436
+
-`Sent` property of `DateTime` type — returns a date and time, stored in the mail message in its original form “as-is”, without adjusting it to the local date time and so on.
437
+
-`Subject` of `String` type — return a subject of the mail message.
438
+
-`From` of `String` type — returns a “From” email address.
439
+
440
+
To obtain a metadata of the given mail message, this mail message initially should be loaded to the [`Viewer`](https://reference.groupdocs.com/viewer/net/groupdocs.viewer/viewer/) class through its [constructor](https://reference.groupdocs.com/viewer/net/groupdocs.viewer/viewer/viewer/#constructor_4), and then the [`Viewer.GetViewInfo()`](https://reference.groupdocs.com/viewer/net/groupdocs.viewer/viewer/getviewinfo/#getviewinfo) method should be called. This method then returns the instance of the [`ViewInfo`](https://reference.groupdocs.com/viewer/net/groupdocs.viewer.results/viewinfo/) class, which should be casted to the [`MailMessageViewInfo`](https://reference.groupdocs.com/viewer/net/groupdocs.viewer.results/mailmessageviewinfo/) type. And that’s all! Source code is below:
0 commit comments