Setup EMails

From Dolibarr Open Source ERP CRM Wiki

Return to user
documentation index

File Doc user.png

Help about screen: EMail setup

Menu path: Home -> Setup -> EMails

The EMails setup screen allows you to setup Dolibarr to send EMails and to test your setup.


E-Mails setup parameters

This is explanation of all setup parameters:

Disable globally all emails sendings (test mode or demo)

Set this to No. If you set to yes (for a demo system for example), no more mail will be sent.

Method to send emails

  • The default method is PHP mail function. This means that Dolibarr use your PHP to send emails. This suppose your PHP setup is complete. If you don't know how to setup PHP for email sending, prefer next method.
  • If your email sending server needs authentication, or if you don't have permission or knowledge to setup your PHP, choose the second method: SMTP/SMTPS socket library (or Swift Mailer socket library if you fails to make the previous one working with your email provider).

Warning.png WARNING

Some email provider (like Yahoo) does not allow you to send an email from another server than the Yahoo server if the email address used as a sender is a Yahoo email (for example,, ...). If you sue the PHPmail method, it means you will use the server of your application to send emails, so some recipients (the one compatible with DMARC protocol), will ask Yahoo if they can accept your email and Yahoo will respond "no" because the server is not a Yahoo server, and some of your Emails may not be received.
If like Yahoo, your Email provider has this restriction, you must set this setup to choose the other method "SMTP/SMTPS socket library" and enter here the SMTP server and credentials provided by your Email provider.

Hostname or ip address of SMTP/SMTPS sending server

Name or IP address of the server that send mail. It is usually an name like provided by your Internet Service Provider.

For example:

  • (with login/pass of gmail or gmail for works account)
  • (with mode relay of gmail for works)

Port of SMTP/SMTPS sending server

If the email sending server use the standard port (25), you can let the field empty.

Other examples:

  • 25 (SMTP standard)
  • 465 (SMTPS gmail of free gmail or gmail for works)
  • 25, 465 or 587 (SMTP gmail with the mode relay available with gmail for works, depending on setup)

SMTP Authentification ID

Visible if you have choose SMTP/SMTPS socket library as sending method. Put here your login.

SMTP Authentification Password

Visible if you have choose SMTP/SMTPS socket library as sending method. Put here your password.

Usage of TLS (SSL)

Some emails servers require encrypted communication (For example the SMTP server of Google It's SMTPS).

The only method that support this protocol is SMTP/SMTPS socket library. You must enable cryptography by setting this method if you need such encryption.

Note: SSL functions must be available in your PHP. If not, you probably forget to install the openssl module of PHP.

Note: There is 2 different types of SMTP secured encoding:

  • Sending SMTP protocol inside a crypted stream (SSL or non standard TLS). Server is often running on port 465.
  • Sending crypted data inside SMTP (TLS using STARTTLS). Server is often running on port 587.

Dolibarr option can manage the first case, the second one is supported started to 4.0+.

More information on difference between TLS and STARTTLS here:

EMail used as sender for automatic emails

EMail that will be used by Dolibarr as emails sender if sender is not explicitly defined.

Examples for common Mail server setup

Gmail (with login/pass)

  • SMTP server:
  • Port: 465
  • SMTP Username: Your Gmail login ( or
  • SMTP Password: Your Gmail password
  • Use TLS: Use TLS (SSL) encrypt: yes / Use TLS (STARTTLS) encrypt: no

Warning.png Because using this smtps access need to store your login/pass into application, this access is classified by Google as a "less secured access". So check such access are enabled on your Google account dashboard "Access for less secured application" on

Warning.png Also, if you have email aliases on your account, be sure to set here the main username and not alias.

Warning.png Note also that when sending email with google smtps, if the email of sender is not the google email, neither a declared alias, google will replace the "From" visible by the recipient with your default email alias (but the reply to will still be the sender email even if not declared)

Note: With this mode, emails sent are automatically added into "Sent" folder.

Gmail (with mode relay of Gmail with GSuite)

  • SMTP server:
  • Port: 25, 465 or 587
  • Use TLS: Depend on relay setup
  • Keep login/pass empty

Note: You must first setup your Google account to relay outgoing email and to set the list of ip of your SMTP clients (, GMail - Advanced setup - Routing). Note: With this mode, emails sent are also saved into "Sent" folder only if option "Stock a copy of all emails sent..." is on.


iCloud does not support SSL/TLS, only TLS with STARTTLS, so you must use Dolibarr 4.0+ to use it.

Setup would be:

  • Server:
  • User name: Your iCloud Mail email address (Do include the domain name—what follows "@" in your iCloud Mail address; if your iCloud Mail email address is "", for instance, do use "" as the user name.)
  • Password: iCloud Mail SMTP password: Your iCloud Mail password or an app-specific password (with two-step authentication enabled)
  • Port: 587
  • Use TLS: Use TLS (SSL) encrypt: no / Use TLS (STARTTLS) encrypt: yes

Office365 / Exchange server

Setup would be:

  • Server: (Microsoft Office 365, Exchange Server).and
  • User name: Your email account
  • Password: Your password account
  • Port: 587
  • Use TLS: Use TLS (SSL) encrypt: no / Use TLS (STARTTLS) encrypt: yes


Setup would be:

  • Server:
  • User name: Your api key
  • Password: Your api pass
  • Port: 2525
  • Use TLS: Use TLS (SSL) encrypt: no / Use TLS (STARTTLS) encrypt: yes

Several smtp logins or servers

If you need to have each user to use a different SMTP login account or a different SMTP server, you might be interested into the module MULTISMTP:


Test server availability

This button is to test if you can communicate with the server. This allow you validate the parameter:

  • Hostname or ip address of SMTP/SMTPS sending server
  • Port of SMTP/SMTPS sending server
  • Usage of TLS (SSL)

Test send email

This button is to test what happens when you send an email with simple text content.

Test send email HTML

This button is to test what happens when you send an email with HTML content.

SPAM troubles

If your email is set as SPAM by your EMail reader, you can test to send en email to this service to get more information why your email is set as SPAM:

Emails Tracking

From version 4.0, all emails sent by Dolibarr contains a header line "Reference" with a tracking information to know from which source element the email were sent. This tracking informations will also be present into the emails answer, but only if the reader sent the answer using the "Answer to" feature of its email reader and not by creating a new email from scratch of course.

Personal tools
  • Ask to to request an account to contribute to this documentation
  • Log in
In other languages
No translation in Deutsch.
No translation in Italian.
No translation in Greek.
No translation in &lt;multilanguagemanager_cn&gt;.

Social networks
Follow us on Google+ Follow us on Facebook Follow us on LinkedIn Follow us on Twitter