php - Can I add custom Message-ID and In-Reply-To header using phpmailer? -


i using phpmailer sending emails, attempting add in-reply-to in email header can't. how can achieve this? can use message-id or references when sending email? there else add references or in-reply-to in phpmailer?

so far have tried add below line in phpmailer

$mail->addcustomheader("in-reply-to: ") 

but it's not working. tried change return path code like

$mail->returnpath = 'bounce_here@domain.com'; 

but did not change return path well.

and 1 more things, can message id using imap php?

yes, can fetch message on imap, extract headers using imap_headerinfo().

once you've got original message id, can insert new message.

you need provide value addcustomheader, not name, as documentation says, this:

$mail->addcustomheader('in-reply-to', $headerinfo['message_id']); 

don't set return path - that's job of message receiver. need set sender property:

$mail->sender = 'bounce_here@domain.com'; 

Comments