What is the common issue faced when using PHPMailer to send emails to multiple recipients from a database?
When using PHPMailer to send emails to multiple recipients from a database, the common issue faced is that the recipients' email addresses are not properly formatted or separated. To solve this issue, you need to ensure that the email addresses are correctly formatted and separated by commas before passing them to PHPMailer's `addAddress()` method.
// Assume $recipientEmails is an array of email addresses fetched from the database
// Format the email addresses and separate them by commas
$recipientEmailsFormatted = implode(',', $recipientEmails);
// Create a new instance of PHPMailer
$mail = new PHPMailer();
// Add the formatted email addresses to the recipient list
$mail->addAddress($recipientEmailsFormatted);
// Send the email
$mail->send();