The reply and return path can be placed in the headers as shown below −
$headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'Return-Path: [email protected]'
Otherwise, it can be passed as the fifth parameter to change the return path −
mail($to, $subject, $message, $headers, "-f [email protected]");
Here, '[email protected]' has to be replaced with the user's respective email id.