Sending Mail with Drupal: A Reliable Setup for Business-Critical Email

Illustrated infographic summarizing: Sending Mail with Drupal: Reliable Email Setup for Business Sites

By Greg Nowak. Updated 5 November 2026.

A Drupal contact form can display a confirmation while the enquiry never reaches your team. Password resets, order updates, and approval requests can disappear in the same gap. For the business, the important question is whether someone can complete their task—and whether your team notices when they cannot.

A dependable setup connects three things: Drupal’s message handling, an authenticated delivery service, and a clear process for investigating failures. Here is how to put those pieces together.

Start with the messages you cannot afford to lose

List your critical messages, who receives them, how quickly they must arrive, and who investigates a failure. Password resets need prompt delivery. Sales enquiries need a recoverable record, so check whether your form actually stores submissions. An email notification should not be the only copy of a potential customer’s request.

For agency handovers, establish who controls the sending account, DNS, credentials, and billing. Give the client access through an organisational account so support can continue after the original developer leaves.

Choose a delivery route your team can support

An approved organisational relay or transactional email service is a practical starting point for many business sites. Look for searchable delivery logs, bounce visibility, suitable authentication, and capacity for busy periods.

Choosing how Drupal sends email
Approach Useful when Check before committing
Authenticated SMTP relay You need routine enquiries and account notifications Authentication, TLS, sending limits, and accessible logs
Core Symfony mail backend Your developer deliberately chooses Drupal’s experimental transport option Installed core version, plain-text output, and existing overrides
Provider API integration You need provider-specific templates or delivery events Module maintenance, compatibility, and failure handling
Local mail server An established infrastructure team operates email delivery Ownership of reputation, DNS, retries, and monitoring

Set up authenticated SMTP without changing everything at once

The SMTP Authentication Support module sends through PHPMailer instead of PHP’s mail(). Its published stable release supports Drupal 10 and 11 and provides this installation command:

composer require 'drupal/smtp:^1.4'

Installation is only the first step. Enable and configure the module in staging, using the provider’s host, port, TLS requirements, authentication method, and permitted sender address. Check existing mail modules and message-specific routing before changing the default backend.

Keep credentials in deployment-managed secrets or environment-specific overrides, and check that configuration exports do not contain them. Keep staging recipients controlled so testing cannot notify real customers.

Understand the core Symfony option before using it

The Drupal 11 core Symfony mail backend is still documented as experimental and sends plain-text messages. It is a transport replacement within Drupal’s existing mail system; choosing it does not provide a complete HTML template system.

If your developer selects this alternative to the SMTP module, the following settings.php override selects the backend and configures an SMTP transport:

$config['system.mail']['interface'] = [
  'default' => 'symfony_mailer',
];
$config['system.mail']['mailer_dsn'] = [
  'scheme' => 'smtp',
  'host' => getenv('SMTP_HOST'),
  'port' => 587,
  'user' => getenv('SMTP_USER'),
  'password' => getenv('SMTP_PASS'),
  'options' => [],
];

Use your provider’s required port and confirm the environment variables exist in the web application’s runtime. Review existing interface mappings before replacing them. Requirements for attachments, HTML templates, queues, or provider APIs need their own compatibility check.

Keep custom message code independent of the transport

Custom modules should compose messages through Drupal’s mail manager so business logic does not depend on one provider. In a service with an injected MailManagerInterface, a call can look like this:

$params = [
  'customer_name' => $customerName,
  'project_name' => $projectName,
];
$message = $this->mailManager->mail(
  'my_module',
  'project_notice',
  $to,
  $langcode,
  $params
);

The module’s hook_mail() implementation must supply the subject and body for project_notice. Parameters alone do not create the content. Check the result and log useful diagnostic context, but remember that Drupal documents success as acceptance at PHP level, which does not guarantee delivery.

Authenticate the domain customers see

Use a controlled address such as [email protected] in From:. Put a contact-form visitor’s validated address in Reply-To:, allowing staff to reply without asking the website to impersonate the visitor’s domain.

Configure SPF and DKIM for the sending service, then introduce DMARC reporting and verify alignment with the visible sender domain. Inventory legitimate senders—including staff email, CRM, invoicing, and newsletters—before tightening DMARC enforcement.

Gmail’s sender guidelines require SPF or DKIM, TLS, and valid forward and reverse DNS for senders to personal Gmail accounts. Bulk senders face additional SPF, DKIM, DMARC, and alignment requirements; marketing and subscribed messages also need one-click unsubscribe. Confirm which infrastructure settings the provider manages and which DNS changes your team must make.

Test the whole journey and make failures visible

A module’s test message proves less than a real password reset or form submission. Make these checks part of launch acceptance:

  • Trigger every critical message through its actual workflow from production-like infrastructure.
  • Check Gmail, Microsoft-hosted email, and an organisational mailbox, including spam folders, authentication results, links, and language.
  • Match test messages to Drupal logs and provider activity using timestamps, recipients, and available message identifiers.
  • Test failure handling in staging and confirm that saved enquiries remain accessible.

Read provider statuses carefully. Amazon SES distinguishes sends, deliveries, bounces, and delivery delays. A delivery event means acceptance by the recipient’s mail server; it does not establish inbox placement or that someone read the message.

Name an owner for alerts and failed messages. If sending uses a queue, monitor its worker or cron process and overdue jobs. Document retry behaviour to avoid duplicate notifications. Repeat delivery checks after hosting moves, DNS changes, credential rotation, and mail-module upgrades.

If enquiries are disappearing or the setup has become difficult to support, ask Greg to review your Drupal email delivery. The review can follow a real message through the system, identify where visibility is missing, and give your team a practical configuration and support plan.

Related on GrN.dk

Need help with this kind of work?

Ask Greg to review your Drupal email setup Get in touch with Greg.

Sources

Seneste artikler

En sendt faktura er ikke nødvendigvis nået frem. Få styr på leveringsstatus, systemkravene i 2027 og afgrænset AI-hjælp til fejl og opfølgning i økonomiafdelingen.

Rækker jeres ChatGPT-licens til weboversættelser? Få overblik over API-kreditter, adgang og en WordPress-proces fra godkendt dansk tekst til oversættelseskladder.

Få styr på manglende bilag med et afgrænset AI-flow, der sorterer svar, koordinerer påmindelser og giver bogholderen en overskuelig liste til opfølgning.

Lad AI skrive kampagneudkast til Black Friday ud fra godkendte produktdata. Få styr på priser, modtagere og godkendelse, før Mailchimp-kladden bliver sendt.

Få tilbudsmails fra Outlook ind i CRM med AI. Afklar felter, dubletter og sælgeransvar, og mål i en pilot, om løsningen sparer tid og får flere forespørgsler fulgt op.

Gør månedsrapporten lettere at gentage med AI til Excel, Python og faste kontroller. Få styr på import, fejllister og afstemning, så tallene kan efterprøves.

Få godkendte timer fra Clockify med på fakturakladder i Dinero. AI skriver ydelsesbeskrivelser, mens faste regler styrer beløb, godkendelse og genkørsler.

Lad AI kundeservice hente ordrestatus fra Shopify og Shipmondo. Se, hvordan I afgrænser opgaven, kontrollerer kundens identitet og sender usikre sager videre.

Når kunden beder om indsigt, kan AI hjælpe med at samle materiale fra WordPress og Microsoft 365. Se, hvordan I holder styr på datakilder, ansvar og kontrol.

Når en ingrediens ændres, kan menukortet kræve rettelser, selv om opskriftsdatoen står stille. Sådan kan AI hjælpe med gennemgang og godkendelse i WordPress.