Catalyst Internet Mail .NET

InternetMail.ExtractFile Method (Int32, String)

Extract the contents of a file attachment and store it on the local system.

[Visual Basic]
Overloads Public Function ExtractFile( _
   ByVal messagePart As Integer, _
   ByVal fileName As String _
) As Boolean
[C#]
public bool ExtractFile(
   int messagePart,
   string fileName
);

Parameters

messagePart
An integer which specifies the message part.
fileName
A string which specifies the name of the file that will contain the file attachment. If the file does not exist, it will be created. If it does exist, it will be overwritten with the contents of the attachment.

Return Value

This method returns a boolean value. If the method succeeds, the return value is true. If the method fails, the return value is false. To get extended error information, check the value of the LastError property.

Remarks

The ExtractFile method writes the contents of a message part, typically a file attachment, to a file on the local system. This method will automatically decode any binary file attachments.

See Also

InternetMail Class | SocketTools Namespace | InternetMail.ExtractFile Overload List