Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

mail.smtp

import mail

Everything here is re-exported by mail, so import mail is enough and the names are called as mail.*. Importing mail.smtp on its own works too and reaches the same definitions.

SMTP: the protocol that moves mail from where it was written to where it is kept.

Both ends are here. SmtpClient hands messages to a server; SmtpServer is the server, and decides what to accept through handlers of your own.

import mail.smtp { SmtpClient }

var server = SmtpClient.connect('smtp://mail.example.com', {
  username: 'reports',
  password: secret,
})

server.send(note, nil)
server.quit()

Submodules

ModuleReached asSummary
mail.smtp.clientmail.*The sending end of SMTP.
mail.smtp.servermail.*The receiving end of SMTP.

2026, Richard Ore and Zuri contributors