What this solution does
The nan.smtp module ensures reliable email delivery from 1C-Bitrix via external SMTP gateways using DKIM signing. Standard sending through the built-in PHP mail() function often results in messages being marked as spam, delayed by mail services, or lost during connection failures. This disrupts client communication, preventing them from receiving order confirmations, invoices, and authorization links. The solution redirects outgoing mail through secure gateways with mandatory authentication, encryption, and digital DKIM signing.
Key features:
External server sending: integration with Yandex 360, Mail.ru for Business, Gmail, VK WorkMail, or a corporate mail server.
Sending log: a registry of outgoing messages recording the date, recipients, subject, gateway used, and delivery status.
Error diagnostics: automatic logging of server response codes and messages during connection failures or authentication issues.
Automatic retry: a background agent initiates repeated sending attempts when a gateway is temporarily unavailable, using a configurable interval.
The module provides reliable email delivery via SMTP with DKIM signature support for 1C-Bitrix platforms. Built-in connection testing allows sending a test email from the control panel to quickly verify credentials without placing orders. Digital DKIM signing ensures correct sender identification by email providers through signing outgoing messages with the domain's private RSA key. The system supports multisite setups, offering independent connection parameters for each site within a single installation. Email streams are separated: dedicated SMTP connections are assigned for store service notifications and mass mailings. Order property macros are passed to email templates, including fields #NAN_...#, #NAN_IMOPRICE#, #NAN_IMODELIVERY#, and #NAN_IMOTRACKING#.
The module operates by intercepting outgoing platform email events at the system level via the standard custom_mail() interface. Instead of the built-in mail() function, a direct secure SMTP connection is established using the PHPMailer library. All events, headers, and gateway system responses are saved to the nan_smtp_logs service table. In case of a network failure or timeout, a background agent activates to retry sending undelivered messages.
The module provides reliable email sending via the SMTP protocol with DKIM signature support for systems based on 1C-Bitrix. Compatibility is confirmed for editions Start, Standard, Small Business, Business, and Enterprise version 18.0.0 and higher. The required version of the main core module main is 18.0.0 and above. The system operates on the PHP environment in the range from version 7.4 to 8.3. Supported database systems include MySQL, MariaDB, and PostgreSQL. The Internet Store module (sale) is required only for generating order property macros; it is not needed for basic email sending. The developer releases updates upon the release of new versions of the 1C-Bitrix platform and the PHP environment. Technical support regarding integration and configuration is provided via email. Configuration is performed after installation: in the module settings section, you must specify email account details, including services such as Yandex, Mail.ru, Google Workspace, or a corporate server. After configuration, the module intercepts outgoing site mail.
The standard PHP mail transport does not pass necessary authentication parameters, causing providers to potentially mark messages as spam. Authorization on an SMTP server with a correct DKIM signature confirms the sender domain's authenticity and increases the likelihood of delivery to the inbox.
If the mail gateway becomes temporarily unavailable, the module logs the error and activates a retry mechanism. Configurable attempt counts and intervals between retries ensure delivery once the connection is restored.
The module architecture supports stream separation: transactional order notifications can be sent via one SMTP server while marketing campaigns use another. This isolates critical service messages from bulk promotional mailings.
The solution supports multi-site environments. Connection parameters can be configured independently for each site within the system.
To enable DKIM signing, activate the option in the module interface, specify the selector, domain, and private key. The generated signature is automatically added to the headers of all outgoing messages.
The module allows automatic insertion of delivery data and tracking numbers into Bitrix email templates. It generates special order property macros, such as #NAN_IMOTRACKING#, #NAN_IMODELIVERY#, along with phone numbers, addresses, and custom fields. These elements can be used in standard Bitrix mailing templates.
To verify functionality without creating a real order, the module provides a test sending tool in the administrative menu. Specify the recipient address, click the send button, and review the delivery log in real time.
General iT can install “Reliable email sending via SMTP with DKIM signature for 1C-Bitrix”, configure its settings and verify its operation in the existing project.