0

I have a Craft 3 site that used Freeform Pro for a contact form. All submissions from this form need to be sent, via email to a third party vendor who parses the information and submits it to a CRM. The format for the emails they receive is very specific: plain-text, utf-8 character set.

When I send a test email from the contact form, it appears to default to ascii if there isn't a utf-8 character in the message. Is there a way to have SwiftMailer to send all emails as UTF-8?

0

Completely untested, but try setting this in your public index.php file right before Craft executes:

\Swift_Preferences::getInstance()->setCharset('UTF-8');

Based on https://swiftmailer.symfony.com/docs/messages.html#setting-the-character-set

  • Is the \ a typo? Looking at the Swift Mailer docs it doesn't seem to be included – Lily K Jun 4 at 18:17
  • Unfortunately, this didn't work. Thank you for the Swift Mailer references though. – Lily K Jun 4 at 18:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.