Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

Getting set up

On new installs, Totara uses the default PHP method of sending mail. 

You can define an SMTP server (as well as other email configuration) on the Outgoing mail configuration page which can be found via the Admin menu > Server > Email.

For site setup and development there are a number of options available to ensure that emails are sent correctly and to allow the content of sent emails to be checked. Importantly these options can also ensure that emails are not sent inadvertently.

Here are some of the options.

Config setting ‘noemailever’

$CFG->noemailever = true;

This setting disables the sending of emails at the point of the emails being sent. This is useful when testing production data in a test environment.

This setting should never be used for production sites.

Config setting ‘divertallemailsto’

$CFG->divertallemailsto = 'developer@example.com';

This will force Totara to divert all email to the specified address. You can use this in conjunction with divertallemailsexceptwhich is a comma-separated list of email addresses or regular expressions that you want to exclude from the diversion.

$CFG->divertallemailsexcept = 'tester@example.com, developer(\+.*)?@example.com';

Mailcatcher

Mailcatcher catches all sent mail and stores it for display within a web browser.

The smtphosts setting will need to be set accordingly, e.g.:

$CFG->smtphosts = ‘localhost:1025’;

Further information can be found at https://mailcatcher.me.

  • No labels