SetSMTP

Description

Sets the SMTP server for mail sending operations.  An attempt to find a server automatically will be made if all parameters are omitted.

Syntax

trg.mail.SetSMTP server, login, password

server (input) - name/address of the mail sever (optionally with a port)

login (input) - username for the mail server

password (input) - password for the mail server

SMTP port could be specified with a standard notation, separating with a colon, like:

trg.mail.SetSMTP "smtp.example.com:587"

Any non-standard port number could be specified, but only if the port number is equal to 465, the SSL will be used for a SMTP connection.

Also, instead of the port number you could specify the letters "TLS".

In this case, the connection will be made to the standard port 25, and then switched to the secured TLS mode (using the STARTTLS command).

For an example:

trg.mail.SetSMTP "smtp.example.com:TLS"

Return value

This function returns true on a success.

Sample

Function Start

  trg.mail.SetSMTP "smtp.office365.com:TLS", login, password

End Function

See also

Platform Objects and Methods

SetPickUpFolder()

target.mail