- πΊπΈUnited States tr Cascadia
This is fundamentaly a core problem: π PhpMail : broken mail headers in PHP 8.0+ because of LF characters Fixed
We are discussing workarounds for Mime Mail in π RfcComplianceException: RFC 2822 Needs work
I recently upgraded PHP on a Windows Server running IIS+FastCGI to 7.4.29 (latest as of this post). Mail sending stopped and an error is shown. The non-descriptive error is "Unable to send e-mail. Contact the site administrator if the problem persists." Nothing more helpful in the error log.
I tested previous versions of PHP back to 7.4.16, which I found to be the last version that works/is compatible in this environment. I then narrowed the problem down to the mimemail module. When uninstalled mail sending works. I further narrowed the issue down to this code in mimemail.inc:
if (!isset($headers['From']) || $headers['From'] == $default_from) {
$headers['From'] = $from;
}
When this is commented out sending works. Does mimemail need to alter these headers?
My guess is this somehow relates to this patch in PHP 7.4.18: https://bugs.php.net/bug.php?id=80710
This took a while to track down. I'm posting here to save some other poor dev. Best to all!
Closed: duplicate
1.2
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
This is fundamentaly a core problem:
π
PhpMail : broken mail headers in PHP 8.0+ because of LF characters
Fixed
We are discussing workarounds for Mime Mail in
π
RfcComplianceException: RFC 2822
Needs work