I am using PHPMailer for sending and replying mail. Here i am facing issue is the reply thread mail is not linked with existing group. It will send separate mail. How can i send it with existing group. I am having thread id. Here is my code.
require_once 'plugins/PHPMailer/src/PHPMailer.php';
require_once 'plugins/PHPMailer/src/Exception.php';
require_once 'plugins/PHPMailer/src/SMTP.php';
$mail = new PHPMailer(true);
$mail->Username = GMAIL_MAIL;
$mail->Password = GMAIL_PWD; // SMTP password
$mail->SMTPSecure = 'tls';
$mail->Port = 587; $mail->setFrom(MAIL_FROM, '');
$mail->addAddress($request['mail_to'], $request['mail_to']);
$mail->addReplyTo(MAIL_FROM, MAIL_FROM);
$mail->addCustomHeader( 'In-Reply-To', '<' . MAIL_FROM . '>' );
$mail->addCustomHeader( 'X-GM-THRID', '' . $request['thread_id']. '' );
$mail->addCustomHeader('References', '[' . $request['thread_id'] . ']');