This is a straightforward task, where we have to include the files and initialize the PHPMailer class, as shown in the following code:
require_once ABSPATH . WPINC . '/class-phpmailer.php'; require_once ABSPATH . WPINC . '/class-smtp.php'; $mailer = new PHPMailer( true );
Then, we can use the $mailer variable object to configure and send e-mails as described in the official documentation.
We can prevent e-mail spamming by authenticating the e-mail through Simple Mail Transfer Protocol (SMTP). Here, ...