What this solution does
Emails sent from a website via the standard PHP mail() function often fail to reach the recipient. This occurs due to missing sendmail configuration on the hosting server, a mismatch between the sender address and the site domain, or a lack of server reputation. Mail services may mark such messages as spam or reject them entirely. The solution is to send emails through the SMTP servers of email accounts on Yandex, Mail.ru, Gmail, or the hosting provider. The module implements this mechanism without requiring any changes to the site templates.
The module integrates into the standard 1C-Bitrix sending system. All outgoing messages pass through it, including email events, responses from contact forms, password recovery notifications, store alerts, and mailing campaigns. No editing of templates or source code is required, and the init.php file remains untouched.
Settings are configured individually for each site. In a multisite installation, each site can have its own SMTP server, email account, and sender rules. The site responsible for sending a specific email is determined automatically based on the email event, the sender address, or the request domain.
Sender configuration. Mail servers accept messages only from an address matching the logged-in account. The module allows replacing the From field with a login, a custom email address, or the site's domain address, while specifying the desired sender name. Bcc, attachments, and both HTML and text versions of the message remain exactly as assembled by the site.
Connection test without sending. A button in the settings initiates a connection to the server, performs authentication, and displays the result before saving the configuration and without sending a test message.
Test sending. A dedicated page sends a message using the settings of the selected site via the same route as all site messages, providing a link to the log entry.
Sending log. Each message records: date, site, source (site, web forms, newsletters, email marketing), recipients, subject, connection type, processing time, status, and the mail server error text. A filter is available for all fields, along with a detailed page showing original headers and message content. Retention period and log volume are configurable; message content can be excluded from storage.
Retry sending. Emails rejected by the server can be resent manually via the log, either individually or in batches. Direct sends are retried automatically by the module using an agent with an increasing delay between attempts. Emails generated by mail events are handled by the 1C-Bitrix core, preventing duplicates.
DKIM signing. Specify the domain, selector, and private key to sign emails; recipients will see the status DKIM: pass.
Dedicated SMTP for newsletters. Emails from the Newsletters and Email Marketing modules can be sent via a separate connection, such as a bulk mailing service, without changing the sender address.
Error notification. After a series of failed send attempts, a notification with a link to the log appears in the admin panel; it disappears after the first successful send.
Diagnostics. The settings tab displays the current email sending path for the site: whether the module is enabled, if another file intercepts the send, if the main module's SMTP is enabled in .settings.php, and whether a password encryption key exists.
SMTP dialogue log. When debugging is enabled, the module records the command exchange with the mail server in a private file and displays it on a separate page, allowing analysis of server rejections without console access.
Important Information
SMTP passwords and DKIM keys are stored encrypted using the site key and are never displayed in the form interface.
The module uses the PHPMailer library, which is included in the main 1C-Bitrix module, and does not connect third-party dependencies.
The standard "Send Email" test in the "System Check" section invokes the PHP mail() function directly and does not verify the module's logic. To validate functionality, use the module's built-in test sending feature.
If the SMTP section is enabled in the bitrix/.settings.php file, the system core sends emails through it before invoking the module. The diagnostic tool will automatically warn about this conflict.
The module declares the custom_mail() function. If this function is already declared in the init.php file (for example, by another SMTP module), the declaration in the module must be removed. The diagnostic tool will identify the conflicting file.
General iT can connect “Top Man Digital: Sending email via SMTP”, install and configure the module, and make sure the integration works correctly.