Category: swiftmailer

How can I make my email username comply with RFC 2822 using swiftmailer in Symfony?

I try to setup the email configuartions for swiftmailer in services.yaml parameters: mailer: smtp_host: ‘abc123.webthing.myhost.de’ smtp_port: 587 smtp_cert: ‘tls’ smtp_username: ‘ab12345-laura’ smtp_password: ‘secret’ This is the mailer service: <?php /** * Service that can be used to send email using…

How do I change Swift Mailer configuration to spool emails when there is no config file when installed from composer

I have installed Swift Mailer using Composer, and it’s all set up and working well. But now I want it to use a spool rather than sending emails immediately. The little documentation I can find says I need to specify…

Swiftmailer pdf attachment from snappy bundle

I have an function downloadPdf($id, KnpSnappyPdf $snappy, Request $request). This function downloads a pdf with information from objects everything works fine. This is the function: public function downloadPdf($id, KnpSnappyPdf $snappy, Request $request): Response { //search id $workOrder = $this->getDoctrine()->getRepository(WorkOrders::class)->find($id); //data…

How to send smtp email from Command using Swiftmailer with Symfony

I have a problem sending my emails with Symfony. swiftmailer.yaml swiftmailer: default_mailer: gmail_api mailers: gmail_api: transport: gmail_api As you can see I’m not using the spooling. My emails are sent correctly from Controller but not from Command. From Controller, send()…

Why casting null to array exits the code?

public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null) { $failedRecipients = (array) $failedRecipients; if (!$this->transport->isStarted()) { $this->transport->start(); } $sent = 0; try { $sent = $this->transport->send($message, $failedRecipients); } catch (Swift_RfcComplianceException $e) { foreach ($message->getTo() as $address => $name) { $failedRecipients[] =…