If you have recently upgraded your PHP version from 7.4 to 8.1 then you would see the error while trying to send emails.
The FATAL error: Uncaught Error: Undefined constant “PHPMailer\PHPMailer\FILTER_FLAG_HOST_REQUIRED.
As we can see from the error message a constant is missing. The FILTER_FLAG_HOST_REQUIRED
filter flag was deprecated in PHP 7.3 and you cannot use this filter flat in latest PHP Version.
7.3.0 | The explicit usage of FILTER_FLAG_SCHEME_REQUIRED and FILTER_FLAG_HOST_REQUIRED has been deprecated. |
Also if you check the latest version of PHPMailer you would identify. There are no longer any references to Filter Flat in the latest PHPMailer code base.
This is the only reason you are seeing the problem Undefined Constant. So to fix it just update your PHPMailer code.
FATAL error: Uncaught Error: Undefined constant "PHPMailer\PHPMailer\FILTER_FLAG_HOST_REQUIRED
How to Fix FILTER_FLAG_HOST_REQUIRED in php 8.xx
As you already know PHP have taken out this built in or default constant and is not useable anymore if you are working on your own script just take it out.
If the problem arised with PHPMailer download latest PHPMailer code here.
Hire a PHP Developer to Fix FILTER_FLAG_HOST_REQUIRED
We can help you to fix the FILTER_FLAT_HOSTED_REQUIRED FATAL error just contact us and lets get this solved.