I'm using PHPMailer class correctly to send emails to multiple email addresses retrieved from the database.
But should I store the emails sent and not sent with their reason in a database table?
I would like to store sent emails in a DB table. Because every sent email can be confirmed by clicking the link on the email with a confirmation code. This response I would like to record.
The response via the link is sent to the server with a unique confirmation code . So the sent record in the table will be updated with a bool/tinyint attribute to record if details in email are confirmed.
Could I allow the emails (sent via smtp with phpmailer) to be stored in sent folder within email account by following this: Sent mails with phpmailer don't go to "Sent" IMAP folder ? That way the email content is atleast accessible as I don't want to store those details in DB
Is it better to record sent email sent in database?
For tracking bounced emails there are solutions: Track emails sent by SMTP with PHP
But what about the event where email is not sent due to an error? Example when this happens:
if(!$mail->Send())
{
echo "Mailer Error: " . $mail->ErrorInfo;
}
Where should I store the error info for each email not sent? Should this be recorded in DB table or put in log file? DB seems more powerful for search and viewing....