class email::SmtpClient

sys::Obj
  email::SmtpClient

Source

SmtpClient implements the client side of SMTP (Simple Mail Transport Protocol) as specified by RFC 2821.

See pod doc and examples.

authCramMd5

Void authCramMd5()

Source

Authenticate using CRAM-MD5 mechanism.

authLogin

Void authLogin()

Source

Authenticate using LOGIN mechanism.

authPlain

Void authPlain()

Source

Authenticate using PLAIN mechanism.

authenticate

Void authenticate()

Source

Authenticate using the strongest mechanism which both the server and myself support.

close

Void close()

Source

Close the session to the SMTP server. Do nothing if session already closed.

host

Str? host

Source

DNS hostname of server.

isClosed

Bool isClosed()

Source

Return true if there is no open session.

log

Log log := Log.get("smtp")

Source

Log for tracing

open

Void open()

Source

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.

password

Str? password

Source

Password to use for authentication, or null to skip authentication.

port

Int port := 25

Source

TCP port number of server, defaults to 25.

send

Void send(Email email)

Source

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.

ssl

Bool ssl

Source

Use SSL for connection (ensure port is configured properly)

username

Str? username

Source

Username to use for authentication, or null to skip authentication.