Sending newsletters safely
This page is for website creators and administrators who send newsletters for real. A newsletter goes to many people at once and cannot be called back, so rehearse first and switch on real sending deliberately.

Contents
The transports
cjw_newsletter.ini [NewsletterMailSettings], overridden in settings/override/cjw_newsletter.ini.append.php:
| Key | Used for |
|---|---|
TransportMethodCronjob | the editions cron sends |
TransportMethodPreview | test sends from the editor |
TransportMethodDirectly | subscription confirmations and info mails |
FileTransportMailDir | where file writes one .eml per mail (default var/log/mail) |
SmtpTransportServer, SmtpTransportPort, SmtpTransportUser, SmtpTransportPassword, SmtpTransportConnectionType | the SMTP connection |
Each method is file, smtp or sendmail. The extension's transports are separate from the site's own mail
settings (10.4 Mail).
From rehearsal to real mail
- Rehearse with
filefor all three methods; read the.emlfiles. - Switch
TransportMethodPreviewtosmtpand send a test to your own address only. - Check how it looks in several mail programs, and that links and the unsubscribe link work.
- Make sure your sender domain is set up at your mail provider (SPF, DKIM); otherwise mail ends up as spam.
- Switch
TransportMethodDirectlyandTransportMethodCronjobtosmtp.
Keep the SMTP password in settings/override/, never in version control.
How a send runs
- Send schedules an edition.
cjw_newsletter_mailqueue_createbuilds the queue: one entry per subscriber.cjw_newsletter_mailqueue_processsends what waits.- The edition is archived (
newsletter/archive).
php runcronjobs.php -s <siteaccess> cjw_newsletter runs both steps; the crontab of
Newsletters with cjw_newsletter runs it every ten minutes.
Before every send
- To do: Test send received and checked.
- To do: Subject, preheader and sender name right.
- To do: Every link works and points to the public site.
- To do: Images have alternative texts; the mail reads well without images.
- To do: The right list is selected.
- To do: The send time suits your readers.
When something goes wrong
| Problem | Do |
|---|---|
| Wrong edition scheduled | abort it with newsletter/send_abort before cron processes the queue |
| Nothing is sent | check that cron runs the parts for the right siteaccess, and the transport is not file |
| Mail is marked as spam | sender domain records, content, and the sending server's reputation |
| Many bounces | check the bounce mailbox; clean the list |
Related pages
- Newsletters with cjw_newsletter
- Newsletter lists and subscriptions
- Cronjobs
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.