Home > Software design >  Symfony Mailer - Migrate addPart from SwiftMailer
Symfony Mailer - Migrate addPart from SwiftMailer

Time:01-13

I am migrating from SwiftMailer to Symfony Mailer in my application.

How to migrate addPart method of SwiftMailer to Symfony Mailer? In my case the content type is text/plain

->addPart('Plain text content', 'text/plain');

using

  • swiftmailer 6.1
  • symfony mailer 4.4

CodePudding user response:

To set the plain text part of your email with Symfony Mailer, you can use

$email->text("...")

See https://symfony.com/doc/current/mailer.html#message-contents for a complete reference

CodePudding user response:

You would just migrate it to

->text('Plain text content')

https://symfony.com/doc/current/mailer.html#message-contents

  •  Tags:  
  • Related