Question

When i send mail to ok@gmail.com using php mailer then In "To" header same Address display two times in mail

Like This: To: ok@gmail.com; ok@gmail.com

simple i used this:

$mail->AddAddress("ok@gmail.com");
$mail->Subject = $subject;
$mail->Body = $body;
$mail->IsHTML(true);
$mail->Send();
$mail->ClearAddresses();
Was it helpful?

Solution

AddAddress must contain 2 values receiver mail and name.

$mail->AddAddress("ok@gmail.com", "Mr. John Smith");

When you don't set name the mail is used for both things mail and name.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top