mod_emailer
[up to 0.6] Sends e-mail using SMTP or sendmail.
As of Zotonic 0.7, e-mail handling is part of Zotonic's core. Read the page about the new e-mail system here.The information below is ONLY for Zotonic 0.6 and below.
This module functions as a simple mailing system for sending text and HTML messages to one or more recipients.
Generic configuration
| Module | Key | Value |
| mod_emailer | email_from | Set this to the from-address you want to e-mail to appear from, e.g. something like noreply@yoursite.com. |
| mod_emailer | email_override | If set, all e-mail messages that get sent from zotonic through mod_emailer go to this address. Usefull if you are testing but don't want to confuse other people with your test e-mails. New in Zotonic 0.5. |
SMTP config
You'll need to fill these config keys:
| Module | Key | Value |
| mod_emailer | smtp_host | The hostname on which the SMTP server is running. Defaults to localhost. |
| mod_emailer | smtp_port | Portnumber for the SMTP server. Defaults to 25. |
| mod_emailer | smtp_ssl | Boolean flag. Put "true" to use SSL for the SMTP connection. Defaults to false. |
| mod_emailer | smtp_ehlo | The hostname for the EHLO command that is sent on initialization of the SMTP session. |
| mod_emailer | smtp_username | SMTP username. Default empty. |
| mod_emailer | smtp_password | SMTP password. Default empty. |
Sendmail config
You can also use the sendmail program to send mails. Sendmail will be called like this: sendmail -f from-address to-address.
| Module | Key | Value |
| mod_emailer | sendmail | /path/so/sendmail |
mod_emailer quickstart
Once you enabled and configured mod_emailer, you can try out these commands to send e-mails:
C
| Command | Explanation |
| z_email:send_admin/3 | Sends a quick e-mail to the site administrator. Handy to notice the site admin that something is wrong, a job has finished, etc... The e-mail that is used is the admin_email address that is specified in the site's config file. |
| z_email:send/4 | Sends a text message with a subject to a specified recipient. |
| z_email:send_render/4 | Renders a template and sends it as a HTML message to a specified recipient. |
This page is part of the Zotonic documentation, which is licensed under the Apache License 2.0.