You’re reading the v0.1 development preview. APIs may change.
~ 1 min readUpdated 2026-10-29

Mail

Elang binds Symfony Mailer to a configured transport. No messages are sent until a real transport is configured.

Configure a transport

MAILER_DSN="smtp://user:password@smtp.example.com:587"

URL-encode credentials. Configure provider-specific encryption and options according to Symfony Mailer's documentation. The default null://null transport intentionally discards messages.

Send a message

use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\Mime\Email;

$message = (new Email())
    ->from('hello@example.com')
    ->to('reader@example.com')
    ->subject('Welcome')
    ->text('Your application is ready.');

$mailer->send($message);

Inject MailerInterface into your application service. Use validated recipient addresses and application-controlled sender addresses.

Delivery model

Sending is synchronous. Delivery depends on your configured provider, DNS, credentials, and transport behavior. For background delivery, register an application job that loads the recipient and calls the injected MailerInterface, then dispatch it through /docs/v0.1/queues. Automatic mail-to-job conversion and a transactional email template catalog are not included.

Need a hand?

Check the troubleshooting guide, look up a term in the glossary, or work through the complete task board project.

Search Elang documentation

Start typing to find your next step.