Symfony's Mailer component helps sending emails and provides integration with the most popular mailing services.
Questions tagged [symfony-mailer]
75 questions
3
votes
1 answer
Symfony Mailer Dynamic Transport from Database
I would like to specify the SMTP server settings (host, port, password, etc.) through an interface and stored them in a database table so that the user can change this without developer intervention.
How can I accomplish this with the mailer…

boonkerz
- 47
- 1
3
votes
2 answers
How to also send BCC to specific address during development with Symfony Mailer?
Symfony provides a way to send all emails to a specific email address during debugging and development but addressees in the BCC still receive the e-mail. This is very dangerous because you don't want to send out any emails from your local dev…

Sil
- 1,120
- 1
- 9
- 30
3
votes
3 answers
How to embed images in a symfony mail?
So I designed an email template for my reset-password system.
In the email templates, there are Images (logo).
I placed those images inside a folder called Email_Images and that folder is placed inside the Public folder!
First, I tried to link the…
user12555687
3
votes
1 answer
PHP Exception with symfony mailer
I'm a beginner with Symfony, and I have to put a Mailer in my web service. But I have a php exception that I don't understand.
There is my mailer function :
private function sendMail(MailerInterface $mailer, $p_leTI, $mail)
{
…

NeoKerd
- 189
- 3
- 13
2
votes
1 answer
Howto set Return-Path in Laravel 9 (Symfony Mailer)
If I just add the header in the mailable:
public function headers()
{
return new Headers(
text: [
'Return-Path' => config('mail.from.address'),
],
);
}
I get an error:
The "Return-Path" header must be an…

PiTheNumber
- 22,828
- 17
- 107
- 180
2
votes
1 answer
How to get email ID when using Symfony Mailer?
In a Laravel 9 project I am using dynamic SMTP setup:
$transport = Transport::fromDsn("smtp://$department->email:$department->smtp_password@$department->smtp_host:$department->smtp_port");
$mailer = new Mailer($transport);
$email = (new Email())
…

Don40
- 373
- 3
- 17
2
votes
0 answers
SES Failed to authenticate on SMTP server with username
in my composer.json i have this
"symfony/amazon-mailer": "^6.0",
"yiisoft/yii2-symfonymailer": "^2.0",
in my main.php i have this
'mailer' => [
'class' => \yii\symfonymailer\Mailer::class,
'viewPath' =>…

Shaho
- 157
- 3
- 15
2
votes
1 answer
Symfony Mailer Twig Context in Subject Line
I am using Symfony 5 and the mailer component with twig templating. The context works fine for the body of the email, but is there not a way to apply that to the email subject line also?
Right now I'm having to manually do my own string replace,…

Rob Irvin
- 111
- 2
- 9
2
votes
1 answer
Howto configure two mail servers (failover) in TYPO3
As stated in the Symfony Docs it is possible, to add a failover configuration for mail servers:
Symfony's mailer supports high availability via a technique called "failover" to ensure that emails are sent even if one mailer server fails.
A failover…

chris
- 2,109
- 2
- 23
- 33
2
votes
1 answer
Problems integrating Postmark with Symfony Mailer
I am currently struggeling trying to use Postmark with the Symfony5 Mailer Bundle. Although the documentation seems to be clear, i am unable to send any emails.
My first point of confusion is the suggested DSN format for…

YanKlinkenick
- 33
- 5
2
votes
1 answer
Use the symfony/mailer component without the symfony framework
I am working on a project that doesn't use any framework and I would like to use Symfony Mailer component to handle sending emails.
The installation part (composer require) was well handled and everything is included in my code without any error.…

user2377141
- 132
- 12
2
votes
1 answer
Shopware: Unable to connect with STARTTLS without encryption
In my .env file I have:
MAILER_URL="smtp://localhost:25?encryption=&auth_mode="
But if I send a mail the log shows:
Could not send mail: Failed sending mail to following recipients: {{ recipients }} with Error: Unable to connect with STARTTLS.…

PiTheNumber
- 22,828
- 17
- 107
- 180
2
votes
3 answers
Symfony messenger and mailer : how to add a binding_key?
I have a running Symfony 4.4 project with messenger and rabbitMQ.
I have an async transport with 2 queues.
transports:
# https://symfony.com/doc/current/messenger.html#transport-configuration
async:
dsn:…

Julien FOURNIER
- 107
- 8
2
votes
0 answers
How to send mail using different queues in new Symfony Mail component
I want to configure Symfony Mail component to send different types of emails using different queue priorities.
How can I do it?
So far I configured the queues:
framework:
messenger:
transports:
async_low:…

HubertNNN
- 1,727
- 1
- 14
- 29
2
votes
1 answer
How to use templated emails with Bootstrap on Symfony Mailer?
I have been following some Symfony Casts tutorial to send emails using Symfony Mailer bundle. I am also using Bootstrap 4 installed with NPM and Webpack Encore. I can't figure out how to provide styles to these templated emails:
Some controller
use…

Maramal
- 3,145
- 9
- 46
- 90