Sent mails with phpmailer don’t go to “Sent” IMAP folder

There is now a method getSentMIMEMessage in PHPMailer which returns the whole MIME string

$mail = new PHPMailer();
//code to handle phpmailer
$result = $mail->Send();
if ($result) {
  $mail_string = $mail->getSentMIMEMessage();
  imap_append($ImapStream, $folder, $mail_string, "\\Seen");
}

Leave a Comment