I
Insight Horizon Media

Does PHPMailer support UTF-8 encoding?

Author

John Castro

Published Feb 10, 2026

Does PHPMailer support UTF-8 encoding?

Plus, you should specify charset (ex: UTF-8) used in the email content because you can not ensure 100 percent people can read your content (which could be captured from different sources) and PHPMailer seems does not detect and change the encoding for you. Fortunately, PHPMailer supports both HTML content and Charset setting as its properties.

Is it possible to send attachments with the PHP mail function?

It is possible, but there is just one problem… To send an attachment with the default PHP mail function, we have to manually define and format a multi-part email. Yes, and that is a rather confusing not-so-straightforward process – Read on for an example!

What do you like most about PHPMailer email transfer class?

With PHPMailer email transfer class, there are 2 things I like best: easy send email with HTML Content and Charset setting (UTF-8 encoding). As you always want to impress your members/customers right after they open your email with a nice template which could be done in one day of a designer.

How to send emails directly by PHP code?

Sending emails directly by PHP code requires a high-level familiarity with Simple Mail Transfer Protocol ( SMTP) standard protocol and related issues (such as Carriage return) and vulnerabilities about Email Injection for spamming. Some of the features of the PHPMailer we would tap into are further listed below:

Why is UTF-8 not working in my email?

That header has no effect on email at all. You’re already doing the only thing that PHPMailer requires for UTF-8 to work: You will need to do the MySQL names setting too. If it’s still not looking correct, it means your handling of the data is not preserving the UTF-8 encoding.

What is the UTF-8 encoding of $mail->charset?

$mail->CharSet = ‘UTF-8’; Andplaced afterthe instantiation of the class (after the new). The properties are case sensitive! See the PHPMailer docfot the list & exact spelling. Also the default encoding of PHPMailer is 8bitwhich can be problematic with UTF-8 data.