Messages sent from Moodle can go through either the PHP mail function or through SMTP server connection. In some cases, the PHP mail function may be disabled on the server (Depending on the hosting company) to prevent spammers from sending emails through compromised websites. To work around this, the email can be configured to connect to an SMTP server. An SMTP connection will connect to an email server with login credentials, authenticating the sending email address. This will allow the receiving email address server to accept the email as authenticated. This is good because some email servers do not allow unauthenticated emails to go through to their server. The following steps will explain how to configure the Moodle 2.3 messaging to use SMTP.
Configuring SMTP settings in Moodle
- Log into the Moodle Dashboard
Navigate to Site administration > Plugins > Message outputs > Email in the settings section.
On the Email page, configure the SMTP settings. By default Moodle will use the PHP mail function to send emails. If the administrator wants the email to go to a specific SMTP server, Like Gmail or Yahoo, the SMTP configuration settings can be adjusted to allow a different server to be used.
In this tutorial, a Gmail email address will be used for the SMTP settings. The following fields will need to be configured for the mail to work. Below is an example of a generic Gmail SMTP set up.
SMTP hosts: smtp.gmail.com:465
(The port number must be attached to the Server host name for the port to be used. The standard configuration for the port will follow the hostname:port# format.)
SMTP security: SSL
(This setting will vary on the email servers SMTP setting requirements. For Gmail, SSL is required for the connection.)
SMTP username: [email protected]
(The full email address for the username)
SMTP password: Password for the email address.
Below is a table with the settings for configuring the email messaging.
Messaging output / Email SMTP hosts The SMTP host is the server the email address connects to. For example, on our servers, the SMTP host will look something like the following:
SMTP security SMTP security will either encrypt the out going email data or not. The SSL setting must match the same type of connection that was used for the SMTP Host name. SMTP username This will be the full email address for the email account. Most email service providers require the entire email address for the username. SMTP password This is the password for the specific email address that is being set up. SMTP session limit This setting can prevent spam coming from the same session on the server. Limiting to 1 will require a new session to be created in order for an email to be set. No-reply address The no reply address is what displays in the return email address. This prevents the email address from being replied to by the recipient. Character set Allows the Character set to be changed to UTF-8, EUC-JP, GB18030, GB2312, ISO-2022-JP, ISO-8859-1, or SHIFT-JIS. Allow user to select character set Enables the users to be able to change the Character set. Newline characters in mail This sets the type of character used for Newline characters.
Once the fields have the correct Email information in them, click Save changes. Now messages sent through Moodle will deliver to the Gmail server as an authenticated user.
Thoughts on “Setting up an SMTP Connection in Moodle”
I want Inmotion to host my University Moodle for education delivery and exams
You can talk with our sales team to find the appropriate hosting solution for your needs. You can find contact information on the InMotion Contact page.