Focal55 wants to be your web guy

Drupal 6 Mail From Name - Setting the From Name for Drupal emails

February
12

By Joe Ybarra, Lead Developer

Tags:

I couldnt find a way to set the From name for auto-generated emails in Drupal 6. My client didnt want the noreply@domain.com to show in the user's email box. They wanted it to look pretty and say the companies name. After tracing this through I realized that the function responsible for firing the email function _user_mail_notify() isnt even built to carry through the $from variable that drupal_mail() has available. Because of this, I can not see a clean way to override this behavior by using the hooks api. The only solution I can think of is to hack includes/mail.inc and modify drupal_mail to force the From name if it is not available. Currently $form is set to NULL. Does anyone have a better solution for this?

Add a Comment