The notification email that should arrive from the contact form does not arrive. Or it arrives, but the subject is a string of symbols. Forms on sites built with PHP sometimes use PHPMailer to build and send emails. If the only line left in the log when sending fails is “Could not connect to SMTP host,” you cannot tell whether the cause is the server certificate, the password or the network.
PHPMailer released 7.3.0 on November 30 (early on December 1, Japan time). The changelog (changelog.md) lists items such as showing the reason when an SMTP connection fails. Although it is not in the changelog, 7.3.0 also includes a change that fixes how subjects are handled in ISO-2022-JP, the character encoding long used for Japanese email.
In this article, based on the changes in the PHPMailer repository and the results of running the same processing on 6.12.0, 7.2.0 and 7.3.0 in a test environment, we summarize what changed and which sites should check.
What changed in 7.2.0 and 7.3.0
Of the 7.3.0 changelog entries, the following points affect form emails.
- Reasons for connection failures: When an SMTP connection fails, reasons such as failure to verify the TLS certificate are now included in the error details
- Responses on authentication failure: Although it is not in the changelog, a commit (6c8936f8) that includes the SMTP server's response in the error when authentication fails is also included
- DSN settings:
DSNConfiguratornow decodes URL-encoded usernames and passwords. Boolean values offalse,off,noand0are now also treated as false - SingleTo: Fixed an issue where, when sending via sendmail or qmail with
SingleToenabled and reusing the same instance, mail was sent again to the recipients of the previous message - PHP 8.6: Calls to
trimnow specify the characters to strip explicitly, avoiding a behavior difference in PHP 8.6
7.2.0, released on November 7, fixed an issue where XOAUTH2 authentication with a long token could fail yet be reported as successful. If you connect to Gmail or Google Workspace SMTP via OAuth, 7.2.0 or later is a prerequisite.
Results of running the same processing on three versions
In a test environment (PHP 8.3.6), we installed 6.12.0 (the last 6.x release), 7.2.0 and 7.3.0 and ran the same script. No email was sent; we extracted the message once it had been built. For SMTP, we set up a TLS server listening with a self-signed certificate and a test server that always rejects authentication within the same environment (one run each).

ISO-2022-JP subjects were fixed only for short ones
PHPMailer's default character encoding is UTF-8. Older forms sometimes still set CharSet to ISO-2022-JP when sending.
ISO-2022-JP represents Japanese using only characters in the 7-bit range. Because the subject contained no 8-bit characters, 6.12.0 and 7.2.0 judged it to be an alphanumeric-only subject and attached the charset label =?us-ascii?...?=. When the 12-character subject “We have received an inquiry” (in Japanese) was read with PHP's mb_decode_mimeheader, it came out as the string of symbols $B$*Ld$$9g$o....
In 7.3.0, the charset label became =?ISO-2022-JP?...?=, and the same subject was readable. Two commits in the repository (911fbdfc and 80614bfc) fix this so that the charset label is kept for 7-bit encodings such as ISO-2022-JP.
However, the 30-character subject “[Inquiry] We have received a request for product materials and a quote” (in Japanese) broke even on 7.3.0. Long subjects are written in two parts, and the split falls in the middle of the Japanese text. With mb_decode_mimeheader, the second half turned into different characters, and with iconv_mime_decode, the second half could not be read. On 6.12.0 and 7.2.0, the 30-character subject was not readable either.
The sender name (From) behaved the same way. 6.12.0 and 7.2.0 wrote the Japanese sender name as the raw character string \033, while 7.3.0 attached a charset label but one character in the second half of the split broke.
When the same subject and sender name were created in UTF-8, all three versions produced readable text, up to and including the 30-character subject.
The reason for send failures is now recorded
When connecting via SMTPS (the port 465 method) to a server with a self-signed certificate, the error from 6.12.0 and 7.2.0 was only “SMTP Error: Could not connect to SMTP host. Failed to connect to server.” In 7.3.0, it was followed by an OpenSSL message containing “certificate verify failed” and the destination it tried to connect to.
With the server that rejects authentication, 6.12.0 and 7.2.0 returned only “SMTP Error: Could not authenticate.”, while 7.3.0 also returned the response text from the server (on the test server, “Authentication failed: test server rejects every login”).
Symbols in DSN passwords
When a username and password with @ and / URL-encoded were passed to DSNConfigurator::mailer(), 6.12.0 and 7.2.0 used the still-encoded values, such as form%40example.com. 7.3.0 decoded them back to form@example.com. For ?SMTPAutoTLS=false, 6.12.0 and 7.2.0 left it enabled (true), while 7.3.0 disabled it (false). If you write your settings as a DSN, upgrading to 7.3.0 means options that previously had no effect will start taking effect.
Which sites should check
Whether a site is affected depends on how the code that sends form emails is written (editorial summary).
CharSetset toISO-2022-JP: In 7.3.0, short subjects become readable, but long subjects and sender names may still break. Forms that insert the inquiry type or company name into the subject produce long subjects. Switching to UTF-8 is the reliable fix- Sending via SMTP: Upgrading to 7.3.0 lets you trace the cause in the logs when sending fails
- Configured with a DSN: Before upgrading, check whether the DSN values contain symbols or encoding, and whether any boolean values are written as text such as
false
In 7.3.0, the error details include the name and port of the server it tried to connect to and the server's response. If your form page displays ErrorInfo as is, change it to show a fixed message on screen and keep the details in the server logs before upgrading (editorial suggestion).
Sites still on 6.x
According to the changelog, 7.0.0 has the same contents as 6.11.1, and the only reason for the major version bump was that lang(), setLanguage() and $language became static, which is incompatible for subclasses. Unless you extend PHPMailer and override these, there is almost nothing to rewrite when moving from 6.x.
Meanwhile, the last 6.x release is 6.12.0 from October 15, 2025. According to the changelog, 6.12.0 reverts the changes in 6.11.0 and 6.11.1, and its contents are the same as 6.10.0. It includes neither the support (6.11.0) for authentication that sends long XOAUTH2 tokens in two parts (RFC 4954) nor the fixes in 7.2.0 and 7.3.0. In the test above, too, 6.12.0 produced the same results as 7.2.0.
If you installed it with Composer, check the version and upgrade as follows.
composer show phpmailer/phpmailer
composer require phpmailer/phpmailer:^7.3
If you placed the src/ files on the server without Composer, check the version with const VERSION in src/PHPMailer.php.
What to check before and after upgrading (editorial suggestion)
- Write down your sending settings. Note
CharSet,Encoding, the SMTP host, port and encryption method, the authentication method (password or XOAUTH2), and whether you use a DSN - Send from staging. With the same settings as production, send yourself an email with a long Japanese subject, and check the subject and sender name in the email clients you use
- Make it fail on purpose. Change one character of the password, send, and check whether the authentication failure response is recorded in the log
- If you use ISO-2022-JP, try UTF-8. Change
CharSettoPHPMailer::CHARSET_UTF8, and check how the received email is displayed and whether the receiving side's systems (for example, if messages are imported into a core business system) can read it
We covered how to reduce sales emails arriving through contact forms in the article on contact forms flooded with sales emails, and the limits on bulk sending from Google Workspace accounts in the article on Gmail sending limits. Points to check when migrating to PHP 8.6 are summarized in the article on PHP 8.6 session cookies.
Scope of verification
On December 1, 2026, we checked the PHPMailer/PHPMailer repository (changelog.md, tag v7.3.0, README.md, UPGRADING.md, SECURITY.md, and the descriptions and diffs of commits 911fbdfc, 80614bfc, 547cd811, 6c8936f8, 3f198833 and 412661c2) and the publication dates on Packagist (desk research). On the same day, in a test environment using PHP 8.3.6 and PHPMailer 6.12.0, 7.2.0 and 7.3.0, we compared the built messages and the results of connecting to a test TLS server and a test SMTP server (hands-on testing; one run each, with no actual sending). Subjects and sender names were read with
mb_decode_mimeheaderandiconv_mime_decode; we did not check how they display in email clients such as Gmail or Outlook. The XOAUTH2 fix (7.2.0) and theSingleTofix were confirmed from the changelog and commits and were not run. We also checked the security advisories in the PHPMailer repository and the GitHub Advisory Database. There were no advisories targeting 7.x, and the most recent advisory in the repository was from June 2021.
For contact form improvements or a review of your site's email sending, please contact us through Website production and renewal consultation.
References
- PHPMailer/PHPMailer — changelog.md(7.3.0)
- PHPMailer/PHPMailer — Keep the charset label for 7-bit ISO-2022 header values(911fbdfc)
- PHPMailer/PHPMailer — Check the charset instead of the ISO-2022 escape sequence(80614bfc)
- PHPMailer/PHPMailer — Include the reason in SMTP connection errors(547cd811)
- PHPMailer/PHPMailer — Include the SMTP server response on authentication failures(6c8936f8)
- PHPMailer/PHPMailer — README.md(7.3.0)
- phpmailer/phpmailer(Packagist)









