Skip to content

Latest commit

 

History

History
25 lines (16 loc) · 911 Bytes

how-do-i-use-phpmailer-to-reply-to-an-email.md

File metadata and controls

25 lines (16 loc) · 911 Bytes

How do I use PHPMailer to reply to an email?

// plain

PHPMailer is a powerful library used for sending emails in PHP. To use it to reply to an email, you need to use the addReplyTo() method. This method takes two parameters: the email address and the name of the recipient.

For example:

$mail->addReplyTo('[email protected]', 'John Doe');

The code above will add a reply-to address to the email.

Code explanation

  • $mail - an instance of the PHPMailer class
  • addReplyTo() - a method of the PHPMailer class used to add a reply-to address to the email
  • [email protected] - the email address of the recipient
  • John Doe - the name of the recipient

Helpful links

onelinerhub: How do I use PHPMailer to reply to an email?