SmtpSocket

interface SmtpSocket(source)

A bidirectional byte stream to an SMTP server that can be upgraded to TLS.

Implement this together with SmtpSocketFactory to run SMTP over a custom transport.

Properties

Link copied to clipboard
abstract val isSecure: Boolean

True once the connection is encrypted.

Functions

Link copied to clipboard
abstract fun close()
Link copied to clipboard
abstract suspend fun flush()
Link copied to clipboard
abstract suspend fun readLine(): String?

Read a line without its line terminator; null once the connection is closed.

Link copied to clipboard
abstract suspend fun startTls()

Upgrade the connection to TLS in place (STARTTLS), verifying the server's certificate.

Link copied to clipboard
abstract suspend fun write(data: ByteArray)

Queue data for sending; call flush to actually send it.