MailBee.NET Objects 7.1

MailMessage.SaveMessage Method (String)

Saves a message into the specified file.

public bool SaveMessage(
   string filename
);

Parameters

filename
The name of the file where it should be saved.

Return Value

true if the message was successfully saved; otherwise, false.

Remarks

The common file extension of e-mails in MIME format is .EML. If you need to produce an .MSG file which can be opened by MS Outlook, use methods of MsgConvert class.

The developer can use LoadMessage method to load the previously saved message.

Exceptions

Exception TypeCondition
MailBeeInvalidArgumentExceptionfilename is a null reference (Nothing in Visual Basic) or an empty string.
MailBeeIOExceptionAn I/O error occurred and ThrowExceptions is true.

Example

The example is available in MailMessage class overview.

See Also

MailMessage Class | MailBee.Mime Namespace | MailMessage.SaveMessage Overload List | LoadMessage