UniFi - How to Set Up the 'Forgot Password' Email Service


Users will learn how to configure the UniFi Network Controller to send email using a free Gmail account and the Gmail Simple Mail Transfer Protocol (SMTP) Server when no other suitable SMTP server is available and UniFi Cloud will not be used. This is needed for the Forgot Password? email to be sent.

PLEASE READ:Google may block sign-in attempts from some apps or devices, in which case you would receive an email stating that a sign-in attempt was blocked, please see Troubleshooting section below for assistance. 


  • Gmail is used for this work instruction, but othermail service providers can be used as long as the SMTP, port and username/password is known.
  • The Settings > Controller section of the UniFi Network Controller is only available to users with Super Administrator role. Check the roles of the users with access to the Controller under Settings > Admins.
  • Configuration of SMTP can only be performed when locally connected to the Controller, and not when connecting over the Cloud.

Table of Contents

  1. Introduction
  2. Steps: How to Set Up Gmail as SMTP Server
  3. Testing & Verification
  4. Troubleshooting


Back to Top

The UniFi Network Controller relies on email to serve Forgot Password requests, invite administrators, and communicate device alerts.

If UniFi Cloud Access is enabled, the controller will automatically make use of the cloud services to send admin invitations (only). This will happen when "Enable Cloud Access" or "Invite to SDN" is checked on the admin invite itself. You still need to configure the SMTP settings for the controller to send most email messages (local account recovery and email alerts), and also to send admin invites without choosing "Enable Cloud Access" or "Invite to SDN".

If UniFi Cloud Access will not be enabled, it is important that an SMTP server is configured to facilitate all email delivery services: Forgot Password requests, email alerts and admin invites.

Steps: How to Set Up Gmail as SMTP Server

Back to Top

Step 1: Create a Gmail Account

Create a new Gmail Account, or use an existing one. Keep in mind emails sent by the UniFi Controller will appear to come from this email account.

Take note of the account credentials (email address and password).

You may also use a Google Apps account, as long as the Google Apps Domain Administrator has not disabled SMTP support. For more information on Google Apps SMTP Support, see https://support.google.com/a/answer/176600?hl=en

NOTE:As stated in this Google support page, if you use 2-Step-Verification you might need to create an App password instead of using your regular Google password before being able to configure the SMTP settings for the controller.

Step 2: Enable SMTP Server Support

In the UniFi Controller, navigate to Settings > Controller > Mail Server section> SMTP Server and check "Enable mail server". Remember to click on Apply Changes when making configuration changes in the UniFi Controller.

Step 3: Configure SMTP Settings

Configure the Mail Server section as follows:

Hostname: smtp.gmail.com
Port: 465 or 587
Enable SSL: Checked
Enable authentication: Checked
Username: Enter the full Gmail email address from Step 1 (including @gmail.com or @your_domain.com)
Password: Enter the account password from Step 1
Specify sender address: Unchecked

Testing & Verification

Back to Top

Enter a valid email address that you have access to in the text box labeled “Send test email to” and click Send. You should see a success message at the top-right corner of the browser screen, and within a few minutes, you should receive a test email confirming the email was sent successfully.

NOTE:If the UniFi Controller shows a Success message when sending the test email, but the test email is not found in the target account's Inbox, be sure to check the All, Spam and Junk folders.


Back to Top

Google may block sign-in attempts from some apps or devices, in which case you would receive an email stating that a sign-in attempt was blocked. If you receive this error or are having trouble with the Google side of things, there are a few things you can try:

1. Follow this work instruction to fix the "sign-in blocked" issue. It is important to note that if your Google account has 2FA verification enabled, it will not allow you to implement this fix.

2. If you wish to use 2FA with your Google account, a possible solution will be to create and use an App password. Please see Google's work instruction on the subject.

Was this article helpful?
58 out of 160 found this helpful
Can't find what you're looking for?
Visit our worldwide community of Ubiquiti experts for more answers
Visit the Ubiquiti Community