Home >Backend Development >PHP Tutorial >Change Return-Path in PHP mail function

Change Return-Path in PHP mail function

王林
王林forward
2023-09-15 19:45:02840browse

Change Return-Path in PHP mail function

The reply and return path can be placed in the header as shown below -

$headers = &#39;From: sample@example.com&#39; . "\r</p><p>" .
&#39;Reply-To: sample@example.com&#39; . "\r</p><p>" .
&#39;Return-Path: sample@example.com&#39;

Otherwise, it can be passed as the fifth parameter to change the return path -

mail($to, $subject, $message, $headers, "-f email@wherever.com");

Here, “email@wherever.com” must be replaced with the respective email ID of the user.

The above is the detailed content of Change Return-Path in PHP mail function. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete