I'm using phpmailer on my website and to help with spam issues I have created a mailbox to send these emails from (using SMTP).
I have set the emails to come from the mailbox address and then I have added a reply to address for where I want the replies to go to:
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'tsl';
$mail->SMTPDebug = 1;
$mail->Host = EMAIL_HOST;
$mail->Port = EMAIL_PORT;
$mail->Username = EMAIL_USER;
$mail->Password = EMAIL_PASS;
$mail->SetFrom('[email protected]', 'Mailbox name');
$mail->AddReplyTo('[email protected]', 'Reply to name');
$mail->AddAddress('[email protected]', 'User name);
The emails send successfully and seem to get through the spam filters ok, but when I press reply it includes both the mailbox account and the reply to account.
Is this what is meant to happen? I only want the reply to address to appear when you press reply. Is this even possible?
Many thanks in advance for any help offered!
Edit:
Looking at the email headers it seems like the from address is getting included in the reply to field. I have no idea why!
Date: Tue, 1 May 2012 11:16:25 +0100
To: User name <[email protected]>
From: Mailbox name <[email protected]>
Reply-to: Mailbox name <[email protected]>, Reply to name <[email protected]
Subject: Email subject
Message-ID: <54c530c0d1f3ff33fc87c4c41c2c9ffd@localhost>
X-Priority: 3
X-Mailer: PHPMailer 5.1 (phpmailer.sourceforge.net)
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="b1_54c530c0d1f3ff33fc87c4c41c2c9ffd"
--b1_54c530c0d1f3ff33fc87c4c41c2c9ffd
Content-Type: text/plain; charset = "iso-8859-1"
Content-Transfer-Encoding: 8bit
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…