SMTPConnection (open)
Handles an SMTP connection to a server
Syntax
LOADLIB "wh::internet/smtp.whlib";
OBJECTTYPE SMTPConnection
Constructor
Variables
Properties
- PROPERTY lasterror
record Last error
- PROPERTY myhostname
Local hostname, set after call to Connect
Functions
- MACRO ClearLastError()
Clears the last error
- MACRO Close()
Closes the connection
- BOOLEAN FUNCTION Connect(STRING server, INTEGER serverport, RECORD options)
Connects to a remote server
- STRING FUNCTION GetErrorMessage()
Get a string with the last error message
- RECORD FUNCTION SendCommand(STRING cmd)
Sends a command to the remote server
- RECORD FUNCTION SendMessage(STRING ARRAY receivers, STRING sender, RECORD ARRAY mimeheaders, RECORD toppart, RECORD options)
Runs the complete flow for sending an e-mail
- MACRO SetTimeout(INTEGER timeout)
Sets the timeout for the underlying TCP connection in milliseconds
- BOOLEAN FUNCTION StartTLS()
Initiates encryption with TLS
- BOOLEAN FUNCTION SupportsTLS()
Returns whether the remote server supports TLS