require ‘wp-includes/class-phpmailer.php’; fixed my problem, but I used a code to create a pdf and then send it in the same way.
require ‘wp-includes/class-phpmailer.php’; fixed my problem, but I used a code to create a pdf and then send it in the same way.