Last Modified: 03.02.2022
Bitrix24 On-premise editions Main module version 21.900.0 has a new SMTP option allowing to organize dedicated email streams.
How emails are sent from site/instance
For Bitrix24 On-premise, user calls a global function bxmail, triggering standard PHP mail function, wrapping an email with headers. After that, mail function queries your internal infrastructure (depending on your
Bitrix Framework requires setup for sending and receiving emails. There are three options for sending emails:
- via local sendmail or postfix (when site uses Linux);
- via third-party SMTP server without authentication (for Windows);
- via third-party server with authentication by replacing email sender function.
: postfix, sendmail or any custom solution, operating based on queues, sending all emails via mail function).
All emails (email campaigns and single emails, CRM emails, password restoration emails, workflows, etc.) are included into a single stream.
Using new local SMTP server settings you can configure dedicated streams as per custom requirements.
Advantages of sender's SMTP server
- dedicated streams;
- use of
Aliases are additional mailbox names. They are used to assign additional names to a single mailbox located at your domain. For example, you have a mailbox email@example.com. You can add an alias marketing<firstname.lastname@example.org> for marketing department. After this action, users receiving an email from marketing department will see only marketing as a sender.
When users respond to this email, their reply is sent to an actual mailbox email@example.com.
- simple setup;
- debugging option;
- option to send on hits;
- option to maintain open connection (useful for bulk mail).
Enabling SMTP server
To enable sender's SMTP server in Bitrix24 On-premise editions, you need to edit the file
Bitrix Framework has a variety of kernel/core settings that do not have visual UI for editing. This is due to updated settings or an error can easily cause the complete system to malfunction (database connection settings, cache settings and etc.).
, by adding the corresponding code:
'smtp' => [
'value' => [
'enabled' => true,
'debug' => true, //optional
'log_file' => '/var/mailer.log' //optional
Important! Extra caution is advised when editing the .settings.php file: a single error can easily cause the complete system to malfunction.
- enabled – enabling the SMTP server for the sender;
- debug – optional parameter (disabled by default). Enable it if you want to see the complete interaction process with SMTP servers;
- log_file – optional parameter. Can indicate a file for collection of logs, by entering full path to file (this file requires access). By default, project/site directory already contains the file mailer.log with all logs incoming logs.
SMTP connection setup
SMTP connection can be configured by two methods:
Are the settings described above connected with SMTP settings at the Bitrix24 Virtual Appliance?
SMTP server settings described in this lesson are not associated with
BitrixVM SMTP settings
Complete the following actions to configure SMTP client:
1. Go to the main menu 6. Configure pool sites > 4. Change e-mail settings on site and enter email host name
Example: BitrixVM site has a configured Gmail
via BitrixVM menu
This lesson contains some examples of email services employed at BitrixVM.
. Add new SMTP connection for Yahoo.com via site administrative section. Now, the From field in a new email or email campaign has a selection of two email services: Gmail and Yahoo. Depending on which service is selected, system sends emails either using Bitrix Virtual Appliance or Bitrix24 core.