1C-Bitrix: Site Manager hands every message to the bxmail() function, which by default calls PHP's mail() — so on most hosts order confirmations and form notifications either never leave the server or arrive unauthenticated and land in spam. Since version 21.900.0 of the main module, Bitrix can send through an authenticated SMTP server instead. It takes one line in a config file and one form in the admin panel.
Menu names below are from the English interface, with the Russian originals in brackets, since most installations run in Russian.
| Setting | Value |
|---|---|
| SMTP host | smtp.postwing.app |
| Port | 587 |
| Encryption | STARTTLS (the connection is upgraded to TLS before login) |
| Username | The login of an SMTP token for your domain |
| Password | The password of that token — shown once, when the token is created |
SMTP connections are ignored until the smtp section is present in /bitrix/.settings.php with 'enabled' => true. The file has no admin UI; edit it over SSH or FTP and add the section inside the main settings array:
<?php
// /bitrix/.settings.php — add the section inside the main settings array
return [
// ...existing sections...
'smtp' => [
'value' => [
'enabled' => true,
'debug' => true, // optional: log the SMTP dialogue
'log_file' => '/var/log/bitrix-mailer.log', // optional: defaults to mailer.log in DOCUMENT_ROOT
],
],
];.settings.php also holds the database connection. Keep a copy before editing and check the brackets and commas after the new section. Go to Settings → Product Settings → Mail and SMS Events → SMTP Settings (Настройки → Настройки продукта → Почтовые и СМС события → Настройки SMTP) and click Add SMTP connection:
| Field | Value |
|---|---|
| Sender name and e-mail | noreply@your-domain.com — on your verified domain |
| Server | smtp.postwing.app for port 587, or ssl://smtp.postwing.app for port 465 |
| Port | 587 |
| Login | The login of an SMTP token for your domain |
| Password | That token's password |
465 is only added when the server address names the protocol explicitly: ssl://smtp.postwing.app. The certificate must be valid and match the host name — a self-signed one fails the handshake. Addresses you pick by hand — in mailings or CRM emails — use the connection directly. System emails (order confirmations, password recovery, web form notifications) go through SMTP only when the default e-mail address matches the sender of one of the configured connections; otherwise Bitrix falls back to the server's own mail setup.
So set the default e-mail address in the main module settings and in the site settings to the same noreply@your-domain.com you used above. Mail templates under Mail and SMS Events → Mail templates use it through the #DEFAULT_EMAIL_FROM# macro; check that none of them hardcodes a different From address.
Reply-To. Every message leaves through bxmail(), so calling it directly tests the whole path:
<?php
// mail-test.php — put it in the site root, open it in a browser, then delete it
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php");
$result = bxmail(
"you@example.com",
"Bitrix SMTP test",
"If this arrived, SMTP is working.",
"Content-Type: text/plain; charset=utf-8\r\n" .
"From: Acme <noreply@your-domain.com>\r\n"
);
var_dump($result); With 'debug' => true, the full SMTP dialogue is written to the log file — to mailer.log in the site root when log_file is not set. Turn debug off once mail flows.
| Symptom | Cause and fix |
|---|---|
Connection saved, mail still goes via mail() | The smtp section is missing from .settings.php, or enabled is not true. |
| Test works, system emails do not | The default e-mail address does not match the connection's sender. |
| Connection on port 465 is not added | Write the server as ssl://smtp.postwing.app. |
| Connection times out | The host blocks outbound ports — use 8587, or 8465 with the ssl:// prefix. |
| Authentication error | Wrong token login or password. |
| Mail goes to spam | A template's From address is on another domain. Use yours, and the visitor's in Reply-To. |
Settings → Product Settings → Mail and SMS Events → SMTP Settings, where Add SMTP connection opens the form. The page only takes effect once the smtp section with 'enabled' => true is in /bitrix/.settings.php — without it, Bitrix ignores the connections created in the admin panel.
Version 21.900.0 of the main module added the smtp option, both to 1C-Bitrix: Site Manager and to the self-hosted Bitrix24. On an older main module, update it first; the alternatives are a Marketplace module or your own custom_mail() function.
System emails — order confirmations, password recovery, web form notifications — go through an SMTP connection only if the default e-mail address matches the sender address of one of the configured connections. Otherwise they fall back to the server's own mail setup. Make the two addresses identical.
Put the protocol in the server address: ssl://smtp.postwing.app with port 465. Bitrix's own documentation notes that the connection will not be added on port 465 without the explicit ssl:// prefix.
Usually because the From field of a mail template holds an address on another domain — often the visitor's own address in web form templates. Your DKIM key and SPF record do not cover it, so DMARC fails. Keep your own address in From and put the visitor's in Reply-To.
No. The connections described here are separate from the SMTP client configured in the BitrixVM menu, and they do not conflict: when the smtp option is on and the sender matches a connection, Bitrix sends through it.