Module postino
postino
build MIME emails (plain text, HTML, embedded images, attachments) and send them over SMTP, or save them as .eml files.
Example
new Email()
.setFrom("sender@example.com", "Sender")
.addTo("alice@example.com", "Alice")
.setSubject("Hello")
.setPlainTextBody("Hello Alice")
.send("smtp://smtp.example.com:587", "user", "password");
Classes
| Name | Description |
|---|---|
Email
|
An email message. Every setter returns the same object, so calls can be chained. Addresses are checked when they are added; send() delivers to every To, Cc and Bcc recipient, and save() writes the same message as an .eml file. |
PostinoException
|
Thrown by postino for invalid input: an invalid address, header, Content-ID or MIME type, a missing sender, recipient or file. Errors of the connection and of the SMTP server are std.net.curl.CurlException. |
Structs
| Name | Description |
|---|---|
OAuth2
|
An OAuth 2.0 access token, for Email.send(url, username, OAuth2(token)). A type of its own, so that a token can't be passed as a password by mistake. |