- Index
- »
- fan.email
- »
- SmtpClient
SmtpClient
class SmtpClient : Obj
SmtpClient implements the client side of SMTP (Simple Mail Transport Protocol) as specified by RFC 2821.
The SocketConfig to use for creating sockets
Password to use for authentication, or null to skip authentication
TCP port number of server, defaults to 25
DNS hostname of server
Open connection using SSL/TLS (ensure port is configured properly)
Username to use for authentication, or null to skip authentication
Authenticate using CRAM-MD5 mechanism
Authenticate using the strongest mechanism which both the server and myself support
Authenticate using LOGIN mechanism
Return true if there is no open session
Close the session to the SMTP server
Send the email to the SMTP server
Authenticate using PLAIN mechanism
Open a session to the SMTP server
Void authCramMd5()
Authenticate using CRAM-MD5 mechanism.
Void authLogin()
Authenticate using LOGIN mechanism.
Void authPlain()
Authenticate using PLAIN mechanism.
Void authenticate()
Authenticate using the strongest mechanism which both the server and myself support.
Void close()
Close the session to the SMTP server. Do nothing if session already closed.
Str? : host
DNS hostname of server.
Bool isClosed()
Return true if there is no open session.
Void open()
Open a session to the SMTP server. If username and password are configured, then SMTP authentication is attempted. Throw SmtpErr if there is a protocol error. Throw IOErr is there is a network problem.
Str? : password
Password to use for authentication, or null to skip authentication.
Int : port
TCP port number of server, defaults to 25.
Void send(Email email)
Send the email to the SMTP server. Throw SmtpErr if there is a protocol error. Throw IOErr if there is a networking problem. If the session is closed, then this call automatically opens the session and guarantees a close after it is complete.
SocketConfig : socketConfig
The SocketConfig to use for creating sockets.
Bool : ssl
Open connection using SSL/TLS (ensure port is configured properly). If false then the connection is opened plaintext, but may still be upgraded to TLS if server specifies STARTTLS.
Str? : username
Username to use for authentication, or null to skip authentication.