# SMTP Emails

Noloco sends automated emails such as [Magic Links](https://guides.noloco.io/settings/login-and-signup/sign-in-options#magic-links) or invitation emails. Custom automated emails can also be sent via [Workflows](https://guides.noloco.io/workflows/workflows#actions). By default, these emails are sent via **<no-reply@noloco.app>.**

Any app can change the **name** that automated emails are sent from, but to change the address you must first configure SMTP settings for your app.

### What is SMTP?

SMTP stands for [Simple Mail Transfer Protocol](https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol). It allows Noloco to send your emails through another service. This means you can send emails from **<myname@mydomain.com>** instead of **<no-reply@noloco.app>**

### What SMTP providers can I use with Noloco?

Noloco supports sending your automated emails through any email provider that provides SMTP Relay support. Such as:

* [SendGrid](https://sendgrid.com/solutions/email-api/smtp-service/)
* [Sendinblue](https://www.sendinblue.com/free-smtp-server)
* [Mailchimp](https://mailchimp.com/developer/transactional/docs/smtp-integration/)
* [Mailjet](https://www.mailjet.com/products/email-api/smtp-relay/)
* [Mailgun](https://www.mailgun.com/products/send/smtp/free-smtp-service/free-open-smtp-relay/)

And many many more

### How do I setup SMTP in my Noloco app?

{% hint style="info" %}
SMTP configuration is only available on [Custom plans](https://noloco.io/pricing). Chat to our team If you want to send emails from a custom email address.
{% endhint %}

1. To set up your SMTP configuration in your app, you need to navigate to your app's email settings page or simply visit this link: <https://portals.noloco.io/~/_/settings/emails>, and you can choose the app you want, or it will automatically open the last active app after 5 seconds.

   <figure><img src="https://319575345-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifpIQWu0HCVYAt51oT%2Fuploads%2Fgit-blob-2726fc2136a3cb454f9c3cb8eb8858a947f066c1%2FSMTP%20Emails.png?alt=media" alt=""><figcaption></figcaption></figure>
2. Enter the email address from which emails should be sent. You will probably have configured this in your email provider. Make sure it matches what you set up, or emails might fail to send.
3. You'll need to get your new email provider's SMTP details, which usually consist of the following details:

* **Host:** The web address of your email provider's SMTP relay server
* **Port:** The network port of the SMTP relay server. Usually, 465 if it connects with SSL
* **Username:** This is how you authenticate with your SMTP server
* **Password:** This is the password that you use to authenticate with your SMTP server. This is often an API key.
* **Is the connection secure?:** If the connection doesn't use SSL/HTTPS please uncheck the ***"Use a secure connection"*** switch.

Click **Save** when you are finished. If Noloco cannot connect to your SMTP server you will get an error. In addition, a test email will be sent. If you don't receive the test email after a few minutes, please double-check that the "From address" you have entered is correct.

If it is, please check your provider's logs to see if the test email failed for any reason.

<figure><img src="https://319575345-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifpIQWu0HCVYAt51oT%2Fuploads%2Fgit-blob-d15bad78496d337ca8d19070dc84335179b62327%2Ftest-smpt-email.png?alt=media" alt=""><figcaption><p>Test SMTP email</p></figcaption></figure>

### Setting up SMTP with Microsoft 365

To use your Microsoft SMTP details with Noloco please use the following configuration:

* **Host:** smtp.microsoft365.com
* Username / Password: Use the values you setup in you Microsoft 365 account
* **Port:** 587
* **Secure:** Off Your SMTP configuration will still communicate over a secure connection, despite having `secure` set to off.

### Setting up SMTP with Gmail

To use your Gmail SMTP details with Noloco please use the following configuration:

* **Host:** smtp.gmail.com
* **Port:** 587
* **Secure:** Off Your SMTP configuration will still communicate over a secure connection, despite having `secure` set to off.
* Username: This will be your gmail email address
* Password: This is not your Gmail password, this is an App password you create for your SMTP app in Gmail. To do this, you must first enable Two-Factor Authentication <https://knowledge.workspace.google.com/kb/how-to-create-app-passwords-000009237>
  1. Sign in to your [Google Account](https://myaccount.google.com/).
  2. Click **Security**.
  3. Under **Signing in to Google**, click **App Passwords**. You may need to sign in. If you don't have this option, it might be because:
     * 2-Step Verification is not set up for your account.
     * 2-Step Verification is only set up for security keys.
     * Your account is through work, school, or other organization.
     * You turned on Advanced Protection.
  4. Click **Select app** and choose the app.
  5. Click **Select device** and pick the device you're using.
  6. Click **Generate**.
  7. Copy this password and use it as the **Password** field in your Noloco app

### Troubleshooting SMTP Setup Issues

**Timeouts when testing your connection**

If you're seeing timeouts when saving your SMTP connection, you should try changing `secure` to off, and leaving the port as it is. This is very often the cause of the issue.

Your SMTP configuration will still communicate over a secure connection, despite having `secure` set to off.

**We could not verify your SMTP config**

If you are encountering this error `getaddrinfo ENOTFOUND smtp.microsoft365.com` please check if your security defaults are enabled in the Azure account settings, follow these steps, and try again:

1. Go to <https://portal.azure.com> and log in with your administrator credentials.
2. In the Azure services section, select Azure Active Directory.
3. On the left panel, scroll down and click on Properties to access the directory settings.
4. At the bottom of the Properties page, click on Manage security defaults.
5. In the right panel that appears, toggle Enable security defaults to No and click Save to confirm.
6. Verify that the changes have been saved, then log out and back in to ensure the settings are updated.

Go back to the SMTP settings in your Noloco app and update the details. Make sure you have:

1. The same email in the Sender email and username
2. The Host is `smtp.office365.com` or `smtp.microsoft365.com`
3. Port is 587
4. The Use a `secure` connection toggle is disabled
