I have a script that sends multiple emails in a loop. Between every email, I reset modMail:
$modx->mail->reset()
Sending becomes really slow since modMail needs to connect to the SMTP server again. I would like to send all emails in a single SMTP session.
I found that PHPMailer has a method clearAllRecipients but the modMail class does not have it. So the following command does not work:
$modx->mail->clearAllRecipients()
Is it safe to call PHPMailer's method directly with the following command:
$modx->mail->mailer->clearAllRecipients()
I am a little worried that something will get later broken if the PHPMailer changes. Or what would be a better solution?