Skip to content
Advertisement

Change Message-ID PHPMailer

Hello I am making a php based mailing application that will connect with a external smtp server and send emails. Now I have managed to match everything but the Message-ID’s @domain-name and Sender domain name are not matching…

This is the result I am getting : Wrong Message ID Header

and this is the result I should be getting (this email is sent from Mailwizz connected with the same SMTP server I am trying to connect with my application)

Expected Message ID Header

send.php file which I am using to connect with SMTP using PHPMailer

JavaScript

Advertisement

Answer

In my experience, you do not need to use addCustomHeader if you want to set the MessageID.

Assuming that you want to set the Message ID to be [random]@send.alok, then please use the following:

JavaScript

Hence, please the following will be ok:

JavaScript

You may refer to the screen dump below for the result

Email received

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement