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

  1. Log into the Moodle Dashboard
  2. smtp-setup-plugin-1-select Navigate to Site administration > Plugins > Message outputs > Email in the settings section.
  3. smtp-setup-plugin-2-smtp 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: mygmail@gmail.com
    (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:
    mail.yourdomaincom (None)
    secure##.inmotionhosting.com (SSL)
    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.

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Like this Article?

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question
n/a Points
2014-04-28 3:11 pm

Hello, this example I worked only a few days and then stop sending the information. Try placing another mail account but neither worked. Any idea what that may be affecting this? My platform is running on a linux server. 

Thank you.

Staff
17,014 Points
2014-04-28 5:03 pm
Hello Silvina,

The procedure should work for any email account as long as the settings are correct. If you are still having issues, you may want to attempt the same settings in an email client such as ThunderBird, Outlook, or MacMail. If it still fails, the the settings are at fault. From there you may want to try different ports and protocols (non-SSL vs SSL, etc).

Kindest Regards,
Scott M
n/a Points
2014-06-23 2:20 am

i'm not getting backup notifications email but i'm getting other email notifiactions like course enrolments etc. can any one tel me the reason for this 

Staff
8,310 Points
2014-06-23 11:18 am
Hello manjunath,

Thank you for your question. Since you are getting email notifications, your SMTP settings are correct.

Have you enabled the backup notifications in the Moodle dashboard settings?

If you have any further questions, feel free to post them below.
Thank you,

-John-Paul
n/a Points
2014-07-17 7:48 am

while  I create user account by email and user trying to open the user did not enter the system so How I can solve this?

Staff
8,310 Points
2014-07-17 10:51 am
Hello Gutema,

Thank you for contacting us. We are happy to help, but will need some additional information.

Can you provide the steps you are taking, so we can follow them?

Are you getting any errors, or bounced/returned emails? What do they say?

If you have any further questions, feel free to post them below.
Thank you,

-John-Paul

What version of Moodle are you using?
n/a Points
2014-07-17 11:49 am

Im really having issues with recipients recieving emails on dia mail boxes when messages are sent on Moodle. I have configured the SMTP settings for my Company's mail server on Moodle. I tried connecting OpenFire (Jabber Server) with Moodle, and still, nothing. Please help.....

Staff
8,310 Points
2014-07-17 11:57 am
Hello Elohor,

Thank you for contacting us. We are happy to help you, but will need more information. When you try to send the emails from Moodle, what is happening?

Are the emails being returned, or going to the Spam box?

Are you getting any errors, what are they.

Have you confirmed you are using the correct email settings?

If you have any further questions, feel free to post them below.
Thank you,

-John-Paul
n/a Points
2014-07-17 11:50 am

Pls help.....

n/a Points
2014-07-17 2:32 pm

Users/ Participants have email addresses contained in dia profile on Moodle. So just to test email sending, I try sending a message to a fellow authenticated user, but the user does not get an email notification. He only gets a pop-up notification when he logs on to Moodle. And that is after checking on all email notification preferences in the 'My Profile>Messaging' belonging to the person's profile. I really dont know where else to try.

Staff
8,310 Points
2014-07-17 3:23 pm
Hello Elohor,

Thank you for contacting us. I recommend reviewing the email logs for the email address you are trying to send an email to.

In the email logs you will see if it is being delivered successfully, or if it is failing before it attempts to send.

If you do not have access to the email logs, your Web Host should be able to review it for you, or provide a copy.

Also, enabling error logs in Moodle may help provide detailed error when the email fails.

If you have any further questions, feel free to post them below.
Thank you,

-John-Paul

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

11 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!