PHPMailer with addReplyTo sends OK but the reply sends to SPAM

64 Views Asked by At

My email is received in the inbox in the gmail account. That part works flawlessly.

The issue is that the reply from the admin gmail account to the sender's email address that is in the addReplyTo fn always goes to that sender's spam folder even in gmail, yahoo, etc.

This is not ideal. Because customers will email and expect replies to go to their inbox and not their spam folder.

Currently: contact form -> admin gmail inbox - replies to sender gmail -> goes to sender gmail spam

Ideally: contact form -> admin gmail inbox - replies to sender gmail -> goes to sender gmail inbox

This may be out of my control but is there anything else I can do? Headers? I already have DKIM set up.

$mail->isSMTP();
$mail->Host     = 'smtp.myhosting.com';
$mail->SMTPAuth = true;
$mail->Username = '[email protected]';
$mail->Password = 'password';
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;


$receiver_email = '[email protected]';
$receiver_name = 'Customer Service';

$sender_email = $_POST["email"]
$sender_name = $_POST["name"]

$mail->setFrom('[email protected]');
$mail->addAddress($receiver_email, $receiver_name);
$mail->addReplyTo($sender_email, $sender_name);

// DKIM signing here
0

There are 0 best solutions below