Symfony's Mailer component helps sending emails and provides integration with the most popular mailing services.
Questions tagged [symfony-mailer]
75 questions
15
votes
3 answers
How to disable "verify_peer" with Symfony Mailer component?
I'm configuring a mail server (postfix), with a self signed certificate, and it seems this self signed certificate is a problem for the Symfony Mailer component.
On Swiftmailer, using some configuration such as:
transport:
stream_options:
…

FTW
- 922
- 1
- 7
- 19
10
votes
1 answer
Monolog: Send error logs by mail causes an extra mail for every error sent
For every error log sent by mail we get another extra email with 2 lines of smtp debug log messages.
Newly created symfony demo (symfony new --demo)
Configured monolog to send error messages by mail as in the docs
symfony/monolog-bundle…

virtualize
- 2,287
- 2
- 25
- 36
7
votes
2 answers
Class "Symfony\Component\Mailer\Bridge\Mailgun\Transport\MailgunTransportFactory" not found on Laravel 9
I just wanted to use Mailgun to send E-mail from my Laravel project and followed this steps from official document: https://laravel.com/docs/9.x/mail#mailgun-driver
composer require symfony/mailgun-mailer symfony/http-client
When I try to send…

Uğur Arıcı
- 1,180
- 1
- 10
- 16
6
votes
1 answer
Error while sending email from symfony mailer via aws ses
My controller which is suitable for sending emails looks like this:
class MailerController extends AbstractController
{
/**
* @Route("/email")
*/
public function sendEmail(MailerInterface $mailer): Response
{
$email =…

dosad
- 151
- 7
6
votes
1 answer
How to send mail with Symfony Mailer using dynamic connection parameters?
I'm trying to send an email with dynamic SMTP connection parameters. These parameters will be retrieved from a DB. So specifying the parameters in .env file (e.g.: MAILER_DSN=smtp://user:pass@smtp.example.com:port) as explained in official docs or…

Genarito
- 3,027
- 5
- 27
- 53
5
votes
5 answers
Laravel 9 SymfonyMailer error - An email must have a "To", "Cc", or "Bcc" header
I've got problems with sending emails after updating a Laravel 8 project using the Metronic 8 theme to Laravel 9. I didn't change any of my code related to emails, but now I got this error using the Sendmail driver :
An email must have a "To",…

Ankh
- 61
- 1
- 7
5
votes
4 answers
How to translate emails when sending them asynchronously with Symfony Messenger?
I configured the Symfony mailer to send emails with messenger.
https://symfony.com/doc/current/mailer.html#sending-messages-async
I have my emails in two languages and I rely on the requests to detect the language, but now the emails are not…

Conde
- 785
- 15
- 31
4
votes
3 answers
How can I mock the Symfony mailer during testing?
I am using the Symfony mailer in a custom class in a Symfony 6 project. I am using autowiring through type hinting in the class's constructor, like so:
class MyClass {
public function __construct(private readonly MailerInterface $mailer)…

thorndeux
- 307
- 2
- 9
4
votes
1 answer
Cannot send emails using Laravel 9
I recently updated to Laravel 9 and now I am no longer able to send emails. In the update log its written that they switched mailer from SwiftMailer to Symfony, so maybe this is the root of the problem.
This is the body of the error that I get…

John Baker
- 73
- 10
4
votes
1 answer
Catching failed email recipients in Laravel 9 (Symfony Mailer)
I have recently upgraded my Laravel application from 5.8 to 9.x. In the previous version of Laravel, mail transport was done by SwiftMailer. But now in Laravel 9, it uses SymfonyMailer.
To get the failed recipient list, Mail::failures() was used,…

Naowas Morshed Eimon
- 43
- 6
3
votes
1 answer
symfony mailer retrieve SentMessage object
I use symfonymailer the way described in Sending Emails with Mailer/Debugging emails
The SentMessage object returned by the send() method of the TransportInterface provides access to the original message (getOriginalMessage()) and to some debug…

endo.anaconda
- 2,449
- 4
- 29
- 55
3
votes
1 answer
Catch failed recipients in Symfony/Mailer 6.x?
In want replace deprecated SwiftMailer v6.3.0 with new Symfony/Mailer v6.x. In old SwiftMailer I collect failed recipients so that I know who has not received mail.
$successfulRecipients = $mailer->send($message, $failedRecipients);
Symfony/Mailer…

user706420
- 1,167
- 3
- 13
- 23
3
votes
2 answers
How to debug Symfony Mailer delivery problems?
I am working on my first Symfony 5 project and struggle to send mail using the build in MailerInterface. I have worked with Swift Mailer in Symfony 3 before and never had similar issues before.
use…

Andrei Herford
- 17,570
- 19
- 91
- 225
3
votes
4 answers
How to get the rendered body of a templated email before sending?
I want to get the render of an email before to send it.
I created a TemplatedEmail with htmlTemplate and context, it works fine for sending but how get the generated template with context to save it in database ? (customer needs)
I tried the…

TikTaZ
- 670
- 1
- 11
- 32
3
votes
1 answer
Symfony 5 Mailer embedded images with liip imagine_filter
In a Symfony 5 project E-Mails are created using the Mailer components TemplatedEmail() function.
In the used twig template ($templatedEmail->htmlTemplate(..)) an image is embedded using
…</div>
<div class=)

user3440145
- 793
- 10
- 34