SmtpTransport
class in package klyn.mails

    public class SmtpTransport extends Object implements AutoClosable:

Object
└ SmtpTransport
All Implemented Interfaces: AutoClosable

Stateful SMTP transport.

This transport supports:

- plain SMTP
- direct TLS SMTP (`MailSecurity.SSL_TLS`)
- SMTP AUTH LOGIN

`STARTTLS` is intentionally rejected with a clear message because it requires a runtime-level TLS upgrade API that `klyn.net` does not expose yet.

    import klyn.mails

    session = Session.smtp("smtp.example.com", security=MailSecurity.SSL_TLS)
    transport = session.openTransport()

Fields

Modifier and Type | Member | Description
--- | --- | ---
public readonly | session `session as Session` | Session bound to this transport.

Properties

Modifier and Type | Member | Description
--- | --- | ---
public readonly property | isConnected `isConnected as Boolean:` | Returns true when the underlying socket is connected.

Inherited Properties
property Inherited Properties from Object: type
Constructors

Modifier and Type | Member | Description
--- | --- | ---
public | SmtpTransport `SmtpTransport(session as Session):` | Creates an SMTP transport.

Methods

Modifier and Type | Member | Description
--- | --- | ---
public override | close `close() as Void:` | Closes the SMTP connection.
public | connect `connect() as SmtpResponse throws MessagingException:` | Opens the SMTP connection and performs greeting, EHLO and optional AUTH.
public | deliver `deliver(message as MimeMessage) as SmtpResponse throws MessagingException:` | Sends one message.

Inherited Methods
method Inherited Methods from Object: deepCopy, fromJson, toDict, toJson, toString, toXml
method Inherited Methods from AutoClosable: close