Updated 2026-11-20
How to Send Drupal Email Through SMTP
Drupal core sends mail with PHP's mail() function and has no SMTP form, so install the SMTP Authentication Support module (composer require drupal/smtp, drush en smtp). Then open Configuration -> System -> SMTP Authentication Support, set SMTP server to smtp.bulko.io, SMTP port 587, Use encrypted protocol to Use TLS, enter your Bulko SMTP username and password, switch Set SMTP as the default mailsystem to On and save with a test address filled in.
Out of the box Drupal 10 and 11 hand every message to PHP's mail() (the php_mail plugin), which relies on a local sendmail binary. On containers, managed PHP hosting and most cloud VMs that binary is missing or sends from an IP address with no reputation, so password reset links, new account emails and contact form messages either never leave the server or land in spam. Core only says Unable to send email. Contact the site administrator if the problem persists.
The fix is to route mail through an authenticated SMTP relay. The most widely used way is the contributed SMTP Authentication Support module (drupal/smtp, works with Drupal ^9.5, 10 and 11, uses PHPMailer). The Symfony Mailer based modules are described further down. Bulko is send-only: it relays what Drupal sends but has no IMAP or mailboxes.
Typical Drupal mail that goes through the relay:
- user emails: password reset, welcome, account activation and blocked/cancelled notices
- site-wide and personal contact forms, including the Send yourself a copy option
- update status notifications to the site administrator
- Drupal Commerce order receipts, Webform notifications and Simplenews newsletters
Drupal SMTP settings
| Field | Value |
|---|---|
| Set SMTP as the default mailsystem | On |
| SMTP server | smtp.bulko.io |
| SMTP backup server | leave empty |
| SMTP port | 587 (or 2525; 465 with Use SSL) |
| Use encrypted protocol | Use TLS (STARTTLS on 587/2525) or Use SSL (465) |
| Enable TLS encryption automatically | On |
| Username | Your Bulko SMTP username (smtp_xxxxxxxxxxxxxxxx) |
| Password | Your Bulko SMTP password (or set it in settings.php) |
| E-mail from address | [email protected] (a domain you control) |
| Allow to send e-mails formatted as HTML | Checked if you send HTML mail (Commerce receipts, newsletters) |
Configure it with drush and keep the password out of config export
Everything on the form lives in the smtp.settings config object, and the module stores the password there as plain text (the form says so). If you commit config/sync to Git, set the secret in settings.php instead and leave the Password field empty. Config overrides are not exported, and the module shows overridden fields as disabled.
For scripted setups the same keys can be set with drush:
composer require 'drupal/smtp:^1.4'
drush en smtp -y
drush config:set smtp.settings smtp_host smtp.bulko.io -y
drush config:set smtp.settings smtp_port 587 -y
drush config:set smtp.settings smtp_protocol tls -y
drush config:set smtp.settings smtp_username smtp_xxxxxxxxxxxxxxxx -y
drush config:set smtp.settings smtp_from [email protected] -y
drush config:set smtp.settings smtp_on true --input-format=yaml -y
drush config:set system.mail interface.default SMTPMailSystem -y
drush crNote the last config:set: the form switches system.mail to SMTPMailSystem when you save it, but setting smtp_on with drush alone does not. Check the result with drush config:get system.mail interface.
Step-by-step setup
- Buy an SMTP package on the Bulko SMTP Relay page and copy the username and password from Dashboard -> SMTP Access. Verifying your domain under Sending domains adds DKIM for it.
- Set the site address first: Configuration -> System -> Basic site settings, field Email address under Site details. Drupal uses it as the From for registration and password emails, so use an address on your own domain.
- Install the module with Composer from the project root:
composer require 'drupal/smtp:^1.4'(this also pulls inphpmailer/phpmailer), then enable it withdrush en smtpor in Extend. - Open Configuration -> System -> SMTP Authentication Support (
/admin/config/system/smtp) and set Set SMTP as the default mailsystem to On. - Under SMTP server settings enter SMTP server
smtp.bulko.io, SMTP port587, Use encrypted protocolUse TLS, and keep Enable TLS encryption automatically on. - Under SMTP Authentication fill in Username and Password. Under E-mail options set E-mail from address and, if needed, E-mail from name; tick Allow to send e-mails formatted as HTML if you send HTML mail.
- Type your own address in E-mail address to send a test e-mail to and click Save configuration.
settings.php override for the SMTP module
<?php
// web/sites/default/settings.php (or settings.local.php)
// Keeps the SMTP secret out of the database and out of `drush config:export`.
// Overridden fields are shown disabled on the SMTP Authentication Support form.
$config['smtp.settings']['smtp_on'] = TRUE;
$config['smtp.settings']['smtp_host'] = 'smtp.bulko.io';
$config['smtp.settings']['smtp_port'] = '587';
$config['smtp.settings']['smtp_protocol'] = 'tls'; // 'tls' = STARTTLS on 587/2525, 'ssl' = port 465
$config['smtp.settings']['smtp_username'] = 'smtp_xxxxxxxxxxxxxxxx';
$config['smtp.settings']['smtp_password'] = getenv('BULKO_SMTP_PASSWORD');
$config['smtp.settings']['smtp_from'] = '[email protected]';
// Make SMTP the default mail plugin even if active config says php_mail.
$config['system.mail']['interface']['default'] = 'SMTPMailSystem';
Symfony Mailer alternatives (Mailer Plus, Mailer Lite, core plugin)
Drupal also has three ways to send through the Symfony Mailer component. They use the same SMTP values: host smtp.bulko.io, port 587, your Bulko username and password. Symfony uses STARTTLS on 587/2525 when the server offers it and implicit TLS on 465.
| Option | Where the SMTP settings go | Notes |
|---|---|---|
Mailer Plus (drupal/symfony_mailer, 2.x for Drupal ^10.3/^11) | Configuration -> System -> Mailer -> Transport: add an SMTP transport (User name, Password, Host name, Port, Perform TLS peer verification) and Set as default. The DSN transport also accepts smtp://USER:[email protected]:587 (URL-encode special characters) | Replaces the whole mail system, so a Mail System setup is no longer used. In 2.x, legacy mail is routed by the Mailer Override submodule (drush mailer:override-info). The project is marked minimally maintained |
Drupal Symfony Mailer Lite (drupal/symfony_mailer_lite) | Configuration -> System -> Drupal Symfony Mailer Lite: add an SMTP transport, set as default; the Test tab sends a test email | Successor to Swiftmailer. Requires the Mail System module: assign it as formatter and sender in Configuration -> System -> Mail System |
Core symfony_mailer plugin (since 10.2) | settings.php only, no UI | Marked experimental and internal by core |
The core plugin needs no module at all:
$config['system.mail']['interface']['default'] = 'symfony_mailer';
$config['system.mail']['mailer_dsn'] = [
'scheme' => 'smtp',
'host' => 'smtp.bulko.io',
'port' => 587,
'user' => 'smtp_xxxxxxxxxxxxxxxx',
'password' => getenv('BULKO_SMTP_PASSWORD'),
'options' => [],
];For a plain site that just needs password resets and contact forms delivered, the SMTP module is the shortest path. Choose a Symfony option if you already use one or need its HTML templating.
Send a test email
The SMTP module sends the test only when you click Save configuration with E-mail address to send a test e-mail to filled in. The subject is Drupal SMTP test e-mail. Drupal then shows A test e-mail has been sent to … via SMTP. You may want to check the log for any error messages. That message means Drupal handed the email to the relay without an error, so confirm it actually arrived.
If it did not arrive, open Reports -> Recent log messages and filter by type smtp. Failures are logged as Error sending e-mail from … to … followed by the PHPMailer error. From the command line you can send the same test message without the form:
drush php:eval "\Drupal::service('plugin.manager.mail')->mail('smtp', 'smtp-test', '[email protected]', 'en', ['subject' => 'Bulko SMTP test', 'body' => ['Sent from Drupal via smtp.bulko.io']]);"For a real-world check, request a password reset at /user/password for a test account or submit the site-wide contact form.
HTML mail, Commerce receipts and contact forms
- Commerce order receipts are HTML (rendered from
commerce-order-receipt.html.twig). With the SMTP module, if Allow to send e-mails formatted as HTML is unchecked the module converts the body to plain text, so customers get a flattened receipt. - Contact forms: core sends the message from the site address and puts the visitor's address in Reply-To, so replies go to the visitor while the relay only sees your own domain in From.
- E-mail from address in the SMTP module overrides the From of every message. If you leave it empty, Drupal falls back to the message's own From, normally the Basic site settings Email address.
- Bulko allows 2,000 emails per day per SMTP access. Large Simplenews sends or bulk order notifications should be spread out, for example by the newsletter module's cron throttle.
Troubleshooting
| Problem | Fix |
|---|---|
| Error sending e-mail ...: SMTP Error: Could not authenticate. (535) | The username or password is wrong, or Password was left empty on first save. Paste both again from Dashboard -> SMTP Access; if you use a settings.php override, check that the environment variable is set for PHP-FPM, not just your shell. More: https://bulko.io/en/smtp-errors/535/. |
| SMTP Error: Could not connect to SMTP host. / timeout on Save configuration | Outbound port 587 is blocked by the host or a container firewall. Switch SMTP port to 2525 with Use TLS, or ask the provider to open 587. |
| Test hangs or fails with an SSL/TLS error | Encryption and port do not match. Use TLS (STARTTLS) goes with 587 or 2525; Use SSL goes only with 465. |
| Unable to send email. Contact the site administrator if the problem persists. and no smtp log entries | Drupal is still using php_mail. Set Set SMTP as the default mailsystem to On, or with Mail System installed assign SMTP Mailer there; check drush config:get system.mail interface. |
| Commerce receipts or newsletters arrive as plain text | Tick Allow to send e-mails formatted as HTML in the SMTP module. Without it the module converts HTML bodies to text. |
| 554 5.7.1 rejected or password reset emails go to spam | Use a From address on your own domain in Basic site settings and E-mail from address, and verify that domain in Bulko for DKIM. Check SPF with https://bulko.io/en/validators/spf-checker/. |
FAQ
Can Drupal send SMTP email without a contributed module?
Only through the experimental core symfony_mailer plugin, configured in settings.php with system.mail mailer_dsn. Core has no SMTP settings form, so most sites use the SMTP Authentication Support module or a Symfony Mailer module.
Should I use the SMTP module or Symfony Mailer?
The SMTP module is the simplest: one form, PHPMailer underneath, no change to how other modules build mail. Mailer Plus or Symfony Mailer Lite make sense if you need HTML templating, attachments handling or already run them. All of them work with smtp.bulko.io on port 587.
Which From address does Drupal use?
By default the Email address in Configuration -> System -> Basic site settings. The SMTP module's E-mail from address, if set, overrides it for every message. Use an address on a domain you control.
How do I keep the SMTP password out of config/sync?
Leave the Password field empty and set $config['smtp.settings']['smtp_password'] in settings.php, ideally from an environment variable. Overrides in settings.php are not exported by drush config:export.
How much does Bulko SMTP cost?
It is a one-time package: $5 for 5,000 emails, $15 for 20,000, $30 for 50,000 or $60 for 150,000. There is no subscription and unused emails do not expire.
Can Drupal receive email through Bulko, for example for replies to contact forms?
No. Bulko is send-only with no IMAP or POP3. Replies go to the Reply-To address, which stays with your regular mailbox provider.
Get SMTP credentials for Drupal
One-time payment by card or crypto, no subscription. Unused emails never expire. 2,000 emails per day per SMTP account.
What you can send: Acceptable Use Policy.