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();
有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top