close
const proc: close (inout smtpConnection: smtp)
-
Close an SMTP connection.
Disconnects from the SMTP server and closes the socket.
openSmtp
const func smtpConnection: openSmtp (in string: hostName,
in integer: smtpPort)
-
Open an SMTP connection to the specified host and port.
- Parameters:
- hostName - Either a host name ("e.g.: "www.example.org"), or an IPv4 address in standard dot notation (e.g.: "192.0.2.235"), or an IPv6 address in colon notation.
- smtpPort - Port to be used for the SMTP connection. SMTP usually uses the ports 25, 465 and 587, but other ports can also be specified.
- Returns:
- an SMTP connection. For an open SMTP connection smtp.sock <> STD_NULL holds. If the connection could not be opened smtp.sock = STD_NULL holds.
login
const proc: login (inout smtpConnection: smtp, in string: user,
in string: password)
-
Login as user with password.
- Parameters:
- smtp - Open smtp connection.
- user - Username to be used for the login.
- password - Password to be used for the login.
- Raises:
- FILE_ERROR - If the login fails.
send
const proc: send (inout smtpConnection: smtp, in string: fromAddr,
in array string: toAddrs, in smtpMessage: message)
-
Send message from fromAddr to toAddrs.
- Parameters:
- smtp - Open smtp connection.
- fromAddr - Address of the sender.
- toAddrs - Addresses of the receivers.
- message - Message to be sent.
- Raises:
- FILE_ERROR - If sending the message fails.
send
const proc: send (inout smtpConnection: smtp, in smtpMessage: message)
-
Send message to the addresses specified in the message.
- Parameters:
- smtp - Open smtp connection.
- message - Message to be sent.
- Raises:
- FILE_ERROR - If sending the message fails.