Hi,

When someone create a new entry in my guestbook Drupal sends out an email to an address I have stated in the Guestbook module settings. But how can I state from which address the mail should be sent from? It doesn't seem to use the email-address I have entered in the Drupal settings (admin/settings/site.information).
Can someone enlighten me on how to specify this?

Regards,
Daniel Eriksson

Comments

JumpingJack@drupalcenter.de’s picture

Hi,

you will get the e-mail-adress configured at site-information as you from-adress, with this coding:

replace after line 442 in guestbook.module

  if ($iSendEmail != '') {
    drupal_mail('guestbook_notification', $iSendEmail, 'New guestbook entry', $message);
  }

with

  $from = variable_get('site_mail', ini_get('sendmail_from'));  
  if ($iSendEmail != '') {
    drupal_mail('guestbook_notification', $iSendEmail, 'New guestbook entry', $message, $from);
  }

ciao

JumpingJack

hba’s picture

Assigned: Unassigned » hba
Status: Active » Fixed

Thanks for the update, JumpingJack. The patch has been commited to 5.x CVS.

Anonymous’s picture

Status: Fixed » Closed (fixed)