LogFile

Description

Enables logging and retrieves operational log information to a file when sending an email.

This function takes no effect when sending an email asynchronously. You can use OnSendFinished to get the error log when sending an email asynchronously.

Applies to

SMTPClient object

Syntax

smtpclient.LogFile (string filepath{, boolean append})

Argument

Description

smtpclient

A SMTP client object identifying the client in which you want to get the operational log information to a file.

filepath

The file path that stores the obtained operational log information.

If the file exists, the information will be appended to it. If not, the file will be created.

If filepath is empty or the file directory is invalid, then the logging function is disabled.

If filepath is null, then the function returns null.

append (optional)

Specifies whether the log information will be appended to the file. Values are:

True -- (Default) The log information will be appended to the file.

False -- The log information will cover the content of the file.


Return value

Integer.

Returns 1 if it succeeds and -1 if it fails. If filepath is null, returns null.

Examples

The following example shows that the log information will be appended to the file.

lnv_SmtpClient.LogFile("c:\mail.log")

The following example shows that the log information will cover the content of the file.

lnv_SmtpClient.LogFile("c:\mail.log",False)

See also

Send

SendAsync

SendAsyncCancel

SetProxy