function wp_mail_smtp_dev_reply_to( $args ) {
$reply_to = 'Reply-To: Maria ';
if ( ! empty( $args['headers'] ) ) {
if ( ! is_array( $args['headers'] ) ) {
$args['headers'] = array_filter( explode( "\n", str_replace( "\r\n", "\n", $args['headers'] ) ) );
}
// Filter out all other Reply-To headers.
$args['headers'] = array_filter( $args['headers'], function ( $header ) {
return strpos( strtolower( $header ), 'reply-to' ) !== 0;
} );
} else {
$args['headers'] = [];
}
$args['headers'][] = $reply_to;
return $args;
}
add_filter( 'wp_mail', 'wp_mail_smtp_dev_reply_to', PHP_INT_MAX );
By using our website you consent to our use of cookies. Click AGREE and carry on browsing the site! Cookie Policy Cookies Policy