SmtpTransport
classin packageklyn.mails
public class SmtpTransport extends Object implements 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 bound to this transport. |
Properties
| Modifier and Type |
Member |
Description |
| public readonly property |
isConnected |
Returns true when the underlying socket is connected. |
Constructors
| Modifier and Type |
Member |
Description |
| public |
SmtpTransport |
Creates an SMTP transport. |
Methods
| Modifier and Type |
Member |
Description |
| public override |
close close() as Void:
|
Closes the SMTP connection. |
| public |
connect |
Opens the SMTP connection and performs greeting, EHLO and optional AUTH. |
| public |
deliver |
Sends one message. |