Call to undefined function PHPMailer\PHPMailer\escapeshellarg() Errors

Symptom

When performing an action that sends an email, an Oops! page displays a Call to undefined function error:

Call to undefined function PHPMailer\PHPMailer\escapeshellarg() in /path/to/whmcs/vendor/phpmailer/phpmailer/src/PHPMailer.php:1730

Cause

The escapeshellarg function is disabled in your server's PHP configuration. For more information see Resolving Warnings on the System Health Status Page.

Solution

Adjust your server's PHP configuration to enable the escapeshellarg function.

For help making this change, contact your hosting provider or system administrator.