How to reset add address in smtp mail in php

In PHP, when using the SMTP mail function to send emails, you can reset the "Add Address" (also known as "Reply-To" or "From") by using the mail() function's optional parameters.

Here's an example:

$headers = array(
    'From' => '[email protected]',
    'Reply-To' => '[email protected]', // reset the "Add Address"
);

$mail = mail('[email protected]', 'Subject', 'Message', implode("\r\n", $headers));

In this example, we're setting the From header to [email protected], and the Reply-To header to [email protected]. This will reset the "Add Address" to [email protected].

Alternatively, you can use the addReplyTo() method of the Swift_Mailer class (if you're using the SwiftMailer library):

$mailer = Swift_Mailer::newInstance();
$mailer->addReplyTo('[email protected]');
$mailer->send($message);

In this example, we're creating a new instance of the Swift_Mailer class, setting the Reply-To address using the addReplyTo() method, and then sending the email using the send() method.

Note that the Reply-To header is not the same as the From header. The From header specifies the sender's email address, while the Reply-To header specifies the email address that should receive replies to the email.

Also, keep in mind that some email clients may not respect the Reply-To header, so it's always a good idea to test your email sending code thoroughly.