Syntax:

SETEMAILSERVERPORT(port_number)

  • port_number: A valid TCP port number

Remarks:

SETEMAILSERVER automatically sets the port to the default SMTP port for SSL or TLS. If your SMTP server uses the standard ports you do not need to use this command.

Return Value:

SETEMAILSERVERPORT will return “OK” if every file has been downloaded successfully.
If the operation fails it will return an error code. You may retrieve the return value and execute various operations depending on this value. See Error Handling.

See also:

SENDEMAIL
SETEMAILSERVER

Sending emails from a script

Examples:

# Set the SMTP server settings
SETEMAILSERVER("smtp.mydomain.com","me@domain.com","the_password")
 
# Set the SMTP server port to 8008 (not using a standard port)
SETEMAILSERVERPORT(8008)
 
# Send the email
SENDEMAIL("me@domain.com","destination@domain.com","","","this is the subject","this is the email body","C:\Users\Carlos\Desktop\scriptftp_log.txt")