Mailtrap.io SMTP settings Here are the settings to use in Mailtrap.io if you want to capture all emails sent from Moodle to a sandbox area (e.g. in test and development environments): $CFG->smtphosts = 'smtp.mailtrap.io:2525'; $CFG->smtpsecure = 'tls'; $CFG->smtpuser = ''; $CFG->smtppass = ''; You can also change these in under Site administration > Server > Email > Outgoing mail configuration. To find your Mailtrap.io username and password visit your inbox, edit the settings (settings cog) and show your credentials.