Expand description
§apiplant-email
One way to send a message, whichever service actually sends it.
An app names a provider in main.toml:
[email]
provider = "sendgrid"
from = "no-reply@example.com"
api_key = "${SENDGRID_API_KEY}"…and a function calls ctx.send_email(...). Everything between those two
points is this crate: it builds the provider’s own request shape, signs or
authenticates it, and normalises the reply to a Sent receipt. Changing
provider to ses changes the wire format, the authentication scheme and
the endpoint — and changes nothing a function can see.
§Supported providers
provider | Transport | Credentials |
|---|---|---|
smtp | SMTP (STARTTLS/implicit TLS) | [email.smtp] host/username/password |
ses | Amazon SES v2 HTTPS API, SigV4 | api_key = access key id, api_secret = secret, region |
sendgrid | api.sendgrid.com/v3/mail/send | api_key |
brevo (sendinblue) | api.brevo.com/v3/smtp/email | api_key |
mailjet | api.mailjet.com/v3.1/send | api_key + api_secret |
mailgun | api.mailgun.net/v3/<domain>/messages | api_key + domain |
postmark | api.postmarkapp.com/email | api_key (server token) |
resend | api.resend.com/emails | api_key |
Anything not on that list still works over smtp, which every one of them
also speaks.
Structs§
- Address
- One mailbox: an address, optionally with a display name.
- Mailer
- A configured, ready-to-use sender.
- Message
- A message to send.
- Sent
- Proof that a provider accepted a message.
Enums§
- Email
Error - What went wrong while sending.
- Provider
- Which service sends the mail.