4AspNet POP3 .NET Component

Attachment.ExtractTNEFAttachments Method 

Method extract all attachments from TNEF.

[Visual Basic]
Public Function ExtractTNEFAttachments( _
   ByVal Path As String _
) As Boolean
[C#]
public bool ExtractTNEFAttachments(
   string Path
);

Parameters

Path
The absolute path to the folder where to save the attachments from TNEF

Return Value

Returns true if any attachments was saved

Remarks

Returns false if ContentType is not "application/ms-tnef". 4AspNet POP3 .NET Component ver. 2.0+ only.

Example

This sample shows how to use the ExtractTNEFAttachments method

...
for (int i = 1; i <= objPOP3.TotalMailCount; i++)
{
    EmailMessage objEmail = objPOP3.GetMessage(i, false);
    if (objEmail.IsAnyAttachments)
    {
        for(int a = 0; a < objEmail.Attachments.Count; a++)
        {
            Attachment att = (Attachment)objEmail.Attachments[a];
            if (att.ContentType == "application/ms-tnef")
            {
                att.ExtractTNEFAttachments(@"c:\temp\"); 
            }
        }
    }
}
...

See Also

Attachment Class | ForAspNet.POP3 Namespace