1

This question already has an answer here:

I am getting from part of a mail sent from my drupal 7 website like below

From: (site mail address) On Behalf Of (sender mail address)

Here I want to remove everything except sender email address, how can I do this?

I have found following url but it is expired

http://www.fosspedia.com/drupal-remove-on-behalf-of-from-the-sent-mails/

Any help???

Thanks

marked as duplicate by AjitS, mpdonadio Sep 26 '13 at 11:17

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

Well you can write a simple module, and in your module insert this function. Here is where i got the idea

function yourmodule_mail_alter(&$message)
{
    $message['headers']['Sender'] = $message['headers']['From'];
}

If you want to go with quick sketch comment, in the link to completely get rid of the headers use

<?php
function mymodule_mail_alter(&$message) {
  unset($message['headers']['Sender']);
  unset($message['headers']['Errors-To']);
  unset($message['headers']['Return-Path']);
}
?>

There is also a module that can help out with this mail headers

Control and modify any (almost any) mail header. Mail Headers allows you to:

  • have you tried it out anytime? – Vamshi Sep 26 '13 at 10:01
  • Yes, and it worked fine. – 4life Sep 26 '13 at 10:02
  • In the above three solutions which one do you suggest me to use with respect to my scenario? – Vamshi Sep 26 '13 at 10:06
  • They are now just two. I would suggest using the last one. – 4life Sep 26 '13 at 10:08
  • With the last solution should I get the sender's email address in the from part? Sorry for asking without trying but my site in live. I will make changes once I get the clear picture. – Vamshi Sep 26 '13 at 10:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.