Skip to content
View in the app

A better way to browse. Learn more.

Froxlor Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

php mail() function OK, PHPMailer not OK

Featured Replies

I'm stumped by this. Code like this works both from the command line (php -f mailtest.php) and via the web. No errors, mail is seen hitting my local ssmtp instance (this host is not running the mail server portion of froxlor):

<?php 
    ini_set( 'display_errors', 1 );
    error_reporting( E_ALL );
    $from = "emailtest@YOURDOMAIN";
    $to = "YOUREMAILADDRESS";
    $subject = "PHP Mail Test script";
    $message = "This is a test to check the PHP Mail functionality";
    $headers = "From:" . $from;
    mail($to,$subject,$message, $headers);
    echo "Test email sent";
?>

WordPress, which uses PHPMailer fails to send mail silently. No errors in php-fpm's log, no errors in apache, and if I turn on php errors and WP_DEBUG, nothing, just silent failure.

Also noticed that when I add new customers in froxlor, there is an error about not being able to send email.  AND froxlor uses PHPMailer.

So what might be stopping PHPMailer from working system-wide, but not php's mail() function?

Don't know for WordPress, but in Froxlor its mostly due to an invalid email address in the settings

  • Author

This is some weird php/phpmailer/pcre2 issue apparently.

For Froxlor, just updating phpmailer to a current version will resolve it (I tested with 6.0.7).  For Wordpress, same thing, have to wait for them to sync up with the current version of phpmailer.

Other workarounds:

- downgrade to php 7.2

- manually build php 7.3 from source using a few specific versions of pcre that don't expose the bug

- in Wordpress, add a filter to disable the regex: add_filter( 'wp_mail_from', function($from){PHPMailer::$validator = 'noregex'; return $from;} )

Just answering here for anyone wandering in from google...  It's vexing because unless you turn on debugging in phpmailer, you get a very generic 'invalid address' error (sender? recipient? who knows?).

So, it's basically a php-7.3+ thing?

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.