public class SmtpTransport extends Object implements AutoClosable:
Stateful SMTP transport.
This transport supports:
MailSecurity.SSL_TLS)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()| Modifier and Type | Member | Description |
|---|---|---|
| public readonly | sessionsession as Session |
Session bound to this transport. |
| Modifier and Type | Member | Description |
|---|---|---|
| public readonly property | isConnectedisConnected as Boolean: |
Returns true when the underlying socket is connected. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | SmtpTransportSmtpTransport(session as Session): |
Creates an SMTP transport. |
| Modifier and Type | Member | Description |
|---|---|---|
| public override | closeclose() as Void: |
Closes the SMTP connection. |
| public | connectconnect() as SmtpResponse throws MessagingException: |
Opens the SMTP connection and performs greeting, EHLO and optional AUTH. |
| public | deliverdeliver(message as MimeMessage) as SmtpResponse throws MessagingException: |
Sends one message. |