Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 922 Bytes

how-do-i-use-phpmailer-to-add-a-reply-to-address.md

File metadata and controls

30 lines (22 loc) · 922 Bytes

How do I use PHPMailer to add a reply-to address?

// plain

You can use PHPMailer to add a reply-to address in the following way:

  1. Include the PHPMailer library in your project:
require 'path/to/PHPMailer/src/PHPMailer.php';
  1. Create a new instance of the PHPMailer class:
$mail = new PHPMailer;
  1. Set the addReplyTo method to add the reply-to address:
$mail->addReplyTo('[email protected]', 'Reply Name');
  1. 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.

onelinerhub: How do I use PHPMailer to add a reply-to address?