I am using drupal_mail
function to send emails from a website. My requirement is mail which are sent from website should have from address
as noreply@website.com
and replyto address
should be testing@website.com
.
To achieve this i followed some below posts:
From addres is working fine but Reply-To
is not setting for the mails. Correct me if am doing anything wrong. Below is the code:
function module_mail_alter(&$message) {
$message['headers']['From'] = $message['headers']['Sender'] = $message['headers']['Return-Path'] = 'noreply@website.com';
$message['headers']['Reply-To'] = 'testing@website.com';
}