Go to page content

E-mail configuration

Any Zotonic system is capable of sending and receiving e-mail messages over SMTP.

Zotonic implements a mailing system for sending text and HTML messages to one or more recipients.

Out of the box, e-mail sending should "just work".

Feedback

If you need feedback on messages that have been sent, enable mod_logging which provides an overview of sent/received and bounced messages.

Site-specific settings

ModuleKeyValue
siteemail_fromSet this to the from-address you want to e-mail to appear from, e.g. something like noreply@yoursite.com.
siteemail_override

If set, all e-mail messages that get sent from zotonic will arrive at this address. Usefull if you are testing but don't want to confuse other people with your test e-mails.

sitesmtphostThe hostname where you want messages to appear from. Mostly used for bounce message handling and the EHLO handshake. Defaults to the site's hostname, but can be overriden
zotonicadmin_emailE-mail address of the admin user, the address where admin log/debug messages get sent to when using z_email:send_admin/3.

Zotonic-wide settings

The file priv/config can be configured to hold any of the configuration options below. They are in effect for every site running in the zotonic instance.

KeyDescription
smtp_relayWhether or not to use a SMTP relay host. Boolean value, defaults to false.
smtp_host

The hostname for the SMTP relay host, only needed if smtp_relay is enabled.

smtp_sslWhether or not to use SSL on the relay host, only needed if smtp_relay is enabled.
smtp_usernameThe username for the relay host, only needed if smtp_relay is enabled.
smtp_passwordThe password for the relay host, only needed if smtp_relay is enabled.
smtp_no_mx_lookupsSet to true to not do a MX lookup before sending mail. (default: false)
smtp_verp_as_fromUse the "from" address as VERP for bounce handling (default: false)
smtp_bccOptionally send a BCC of every sent to this address
email_overrideA global e-mail override. The override logic first checks the site override, and then the global override address.
smtp_spamd_ipOptional IP address for a spamassassin host
smtp_spamd_portOptional port number for a spamassassin host
smtp_bounce_domainWhich domain to use for bounce VERP messages. Defaults to the smtp domain.

This page is part of the Zotonic documentation, which is licensed under the Apache License 2.0.