InMotion Hosting Support Center

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:
    (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:
    (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) (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.

Continued Education in Course 108: Managing Moodle Plugins
You are viewing Section 5: Setting up an SMTP connection in Moodle
Section 4: Managing Enrollments in the Moodle plugins

Support Center Login

Social Media Login

Social Login Joomla

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.

39,789 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 

25,072 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,

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?

25,072 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,


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.....

25,072 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,

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.

25,072 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,

n/a Points
2014-11-07 8:49 am



I am not ablble to configer my Rediffmail pro mail server in moodle. Please suggest how can I configure my mail server.




10,077 Points
2014-11-07 12:16 pm
Hello Shatrughan Jha,

The article above would assist you in setting up an smtp connection to any SMTP server. I took a look into the Rediffmail server and it looks like the server hostname would be

Kindest Regards,
TJ Edens
n/a Points
2015-04-23 7:33 pm


i was wondering if anyone can help with this. can I recieve email messaging as user in noodle from and external emailing system? E.g. Another noodle system,

25,072 Points
2015-04-24 12:00 pm
Hello Tej,

Thank you for your question. Yes, Moodle does have the ability to receive email.

Here is a link to the Official Moodle documentation on Incoming mail configuration.

Thank you,
n/a Points
2015-08-26 5:38 pm

We use a Moodle plugin that uses our smtp on our server to send emails in bulk. But we had problems with aol, yahoo, and not delivering the mail and giving a 505 email error and calling it abuse. host[IP address] said:    550-[our IP Address] blocked by ldap:ou=rblmx,dc=att,dc=net 550 Error -    Blocked for abuse. See (in reply to MAIL FROM    command)



34,939 Points
2015-08-26 5:46 pm
Hello Ycram,

Unfortunately, if you're using their email servers (or ours) to send emails "in bulk" then if it exceeds the typical hourly limit then it would be normally identified as spamming. You can purchase a vps/dedicated server with your own IP address and then use it to send the emails out, but you would be responsible for maintaining the reputation of your email server. If it were to be blacklisted, then you would need to work with the agency that blacklisted in order to be de-listed. There are also services out there (e.g. mail chimp) who send out mass emails as part of their service. If you are simply trying to send a lot of emails out to your moodle users, then I would highly suggest a vps/dedicated mail server, or company that provide email services.

Arnel C.
n/a Points
2015-08-28 12:14 pm

How can you add multiple smtp server? say for both yahoo and gmail as users they have different email addresses......


10,077 Points
2015-08-31 2:02 am
Hello Songela,

I am not aware of a plugin that allows this but if you wanted to send from multiple email addresses you would need to change the settings manually before sending the emails out.

Best Regards,
TJ Edens
n/a Points
2016-06-17 2:48 am


I have a Google Apps for Business account and I am a little confused to what I should put in the SMTP Hosts: is it as suggested above or would it be my domain mail address:  

Could someone help me with this one?




10,077 Points
2016-06-20 9:11 am

You have to have some kind of email address going to that folder as the url is not your email address.

Best Regards,
TJ Edens

Post a Comment

Email Address:
Phone Number:

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

27 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?


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:
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!