phpmailerHow do I use PHPMailer to add a reply-to address?
You can use PHPMailer to add a reply-to address in the following way:
- Include the PHPMailer library in your project:
require 'path/to/PHPMailer/src/PHPMailer.php';
- Create a new instance of the
PHPMailerclass:
$mail = new PHPMailer;
- Set the
addReplyTomethod to add the reply-to address:
$mail->addReplyTo('[email protected]', 'Reply Name');
- Send the email as usual:
$mail->send();
The addReplyTo method takes two parameters: an email address and the name of the recipient.
You can find more information about PHPMailer and its addReplyTo method in the official documentation.
More of Phpmailer
- How do I use PHPMailer to attach a ZIP file?
- How can I use PHPMailer with XAMPP on a localhost?
- How can I use PHPMailer without SMTP secure?
- How can I configure PHPMailer to support Polish characters?
- How can I send emails using PHPMailer without using SMTP?
- How do I determine which version of PHPMailer I'm using?
- How do I configure PHPMailer to use TLS 1.2?
- How can I use PHPMailer in Yii 1?
- How can I configure PHPMailer to ignore TLS certificate errors?
- How can I configure PHPMailer to work with GoDaddy?
See more codes...