Session
classin packageklyn.mails
public class Session extends Object:
SMTP session configuration inspired by JavaMail `Session`, adapted to Klyn.
Instead of a generic property bag, the main SMTP concerns are exposed as
typed properties: host, port, security mode, credentials and TLS context.
import klyn.mails
session = Session.smtp("smtp.example.com", security=MailSecurity.SSL_TLS)
session.userName = "robot@example.com"
session.password = "secret"
Fields
| Modifier and Type |
Member |
Description |
| public |
Session(host |
Creates a mail session. |
Properties
| Modifier and Type |
Member |
Description |
| public property |
authenticator |
Optional lazy authenticator. |
| public readonly property |
clientName |
Returns the EHLO/HELO client name. |
| public property |
defaultFrom |
Optional default sender address. |
| public readonly property |
effectivePort |
Returns the effective SMTP port for this session. |
| public property |
heloName |
Optional EHLO/HELO client name. |
| public property |
host |
SMTP host name. |
| public property |
password |
SMTP login password. |
| public property |
port |
SMTP port. |
| public property |
security |
Plain SMTP, direct TLS or STARTTLS. |
| public property |
sslContext |
Optional TLS context for direct SMTPS connections. |
| public property |
userName |
SMTP login user name. |
Methods
| Modifier and Type |
Member |
Description |
| public |
deliver |
Sends a message through this session. |
| public |
openTransport |
Opens an SMTP transport bound to this session. |
| public static |
smtp |
Creates an SMTP session. |