AttachmentIsMessageInside Property |
Indicates if the attachment contains a mail message.
Namespace: MailBee.MimeAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax public bool IsMessageInside { get; }
Public ReadOnly Property IsMessageInside As Boolean
Get
Property Value
Type:
Booleantrue if the attachment is a mail message; otherwise,
false.
Remarks
For instance, if the mail message was forwarded as attachment to another message,
the developer can use this property to determine whether the attachment contains the forwarded message.
If it does,
GetEncapsulatedMessage method can be used to extract the encapsulated
MailMessage
object from the attachment.
Examples This sample loads the message from .EML file and displays subjects of all attached e-mails.
using MailBee;
using MailBee.Mime;
MailMessage msg = new MailMessage();
msg.LoadMessage(@"C:\Docs\TestMail.eml");
foreach (Attachment attach in msg.Attachments)
{
if (attach.IsMessageInside)
{
MailMessage attachedMsg = attach.GetEncapsulatedMessage();
Console.WriteLine("Forwarded message subject is " + attachedMsg.Subject);
}
}
Imports MailBee
Imports MailBee.Mime
Dim msg As New MailMessage
msg.LoadMessage("C:\Docs\TestMail.eml")
For Each attach As Attachment In msg.Attachments
If attach.IsMessageInside Then
Dim attachedMsg As MailMessage = attach.GetEncapsulatedMessage()
Console.WriteLine("Forwarded message subject is " & attachedMsg.Subject)
End If
Next
See Also