Download the PHP package lettermint/symfony-mailer without Composer

On this page you can find all versions of the php package lettermint/symfony-mailer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package symfony-mailer

Official Lettermint bridge for Symfony Mailer

Latest Version on Packagist Tests Total Downloads Join our Discord server

Send email with Lettermint through Symfony Mailer.


Requirements

Installation

Install the package with Composer:

Configuration

Registering the Transport

Add the factory service to config/services.yaml:

Setting Your Project Token

Set the DSN in .env.local:

Use a project token. URL-encode the token if it contains reserved URL characters. Configure Symfony Mailer to read the DSN:

The factory registration is required. Installing this third-party package alone does not add its factory to Symfony's built-in factory list.

Usage

Sending Emails

Use MailerInterface and Email to send an email:

Standalone Mailer

Use this registry to resolve the custom DSN. Transport::fromDsn() uses Symfony's built-in factories and does not discover this package.

Email Options

Routes and Delivery Settings

The DSN accepts route, timeout, track_opens, track_clicks, and tls:

route is a route slug. timeout is a positive number of seconds and limits both inactivity and total request duration. It defaults to 15. tls is opportunistic or enforced; it controls email delivery, not HTTPS certificate verification.

To override options for one email, add an OptionsHeader:

The options header is removed from the delivered email. It supports route, scheduled_at, settings, tag, and tags. Per-email settings override the corresponding defaults. Other default settings remain active. Named tags replace the default list. Scheduling also accepts API-supported English date expressions; use an explicit time zone for absolute timestamps.

These options remain part of the email when it is serialized for Symfony Messenger. Set options and idempotency keys before the message enters the queue.

Tags and Metadata

TagHeader maps to the API's single tag field. If several are present, the last one wins, as in the Laravel driver. X-LM-Tag is a fallback. Use OptionsHeader for named tags. Each MetadataHeader adds one string entry to metadata.

Idempotency

The idempotency key goes into the HTTP request header, not the delivered email. The bridge does not generate content-based keys or retry requests. A custom injected HTTP client can have its own retry policy. Use the same explicit key when your application repeats a send.

Recipients and Attachments

The transport uses the envelope sender and recipients. It includes CC and BCC only when those addresses remain in the envelope. This supports Symfony's recipient overrides without sending to excluded addresses. Address matching uses mailbox values, not PHP object identity. Duplicate envelope recipients are sent once.

The API requires a non-empty to array. The bridge rejects CC-only and BCC-only envelopes before making an HTTP request. It does not move a hidden recipient into the visible To field.

Normal attachments, file attachments, stream attachments, and inline images are supported. The bridge encodes the original attachment bytes as base64, independent of MIME transfer encoding. It reads the rendered MIME body so inline cid: references match the attachment content IDs. MIME type parameters, such as a calendar method, are preserved.

Text and HTML emails are supported. Arbitrary raw MIME, signed/encrypted bodies, and unsupported MIME parts cannot be represented by the sending API.

Responses

Successful requests require HTTP 202 and a non-empty message_id. Calling $transport->send($email) returns a SentMessage; its getMessageId() returns the exact API ID. MailerInterface::send() returns no value. Use SentMessageEvent to read the ID in a Symfony application.

The API ID is a transport ID. It is not changed into an RFC Message-ID. This differs from the Laravel driver's @lmta.net suffix. To preserve a custom email Message-ID at the API, include both the Message-ID and X-LM-Preserve-Message-ID: true headers.

Error Handling

API failures raise Lettermint\SymfonyMailer\Transport\ApiException, a Symfony TransportException. It exposes statusCode and a token-redacted responseBody. Network failures raise TransportException. HTTP debug data is not attached to messages or exceptions because it can contain the project token. Redirects are disabled. Requests use the fixed HTTPS API endpoint.

Testing

The standalone example uses a mock HTTP client by default. To send one real email, set LETTERMINT_PROJECT_TOKEN, LETTERMINT_FROM, LETTERMINT_TO, and LETTERMINT_IDEMPOTENCY_KEY, then run php examples/standalone.php --send.

Development

API contract checks The source contract test uses a payload accepted by the actual API's `MessageRules`, plus immediate and scheduled responses from `SendMailController`. The source record contains file and fixture hashes. To check the API checkout again: This command also exports fresh controller responses and runs the API request rules against the sample payload. It does not send email or write to the database. It does not test domain ownership, authentication, or production delivery. The design follows Symfony's [Resend bridge](https://github.com/symfony/resend-mailer), [MailerSend bridge](https://github.com/symfony/mailer-send-mailer), and [custom transport factory interface](https://symfony.com/doc/current/mailer.html#custom-transport-factories). The Laravel driver's options and message mapping were also reviewed. The bridge has no Laravel or Lettermint PHP SDK dependency. See [.github/WORKFLOWS.md](.github/WORKFLOWS.md) for CI and release setup.

Changelog

See CHANGELOG.md for release changes.

Support

For help, join the Lettermint Discord server.

Credits

License

The MIT License (MIT). See LICENSE for details.


All versions of symfony-mailer with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
psr/event-dispatcher Version ^1.0
psr/log Version ^1.1 || ^2.0 || ^3.0
symfony/http-client Version ^6.4 || ^7.4 || ^8.0
symfony/http-client-contracts Version ^3.0
symfony/mailer Version ^6.4 || ^7.4 || ^8.0
symfony/mime Version ^6.4 || ^7.4 || ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lettermint/symfony-mailer contains the following files

Loading the files please wait ...