Drupal eMail: Fixing from and reply-to information
Recently came across this fix for email handling of contact form results.
In Drupal 5 and 6 email gets sent from the server (unless you have SMTP module installed) so if a user sends you an email through the contact form, when you go to hit reply you will just be replying to the server.
Unfortunately until Drupal 7 comes out, you need to hack core to fix this.
Contact Form Fix For Drupal 6 (From and Reply-To Formation) Chad_Dupuis - May 17, 2009 - 04:03 In drupal 6 you can use hook_mail_alter to change the information within a particular module (or globally if you build your own module) to correct this issue. My code for d6 to correct mails from the contact module is as follows (add the following to the end of contact.pages.inc)
+ +function contact_mail_alter(&$message) { + $properfrom = variable_get('site_mail',''); + $properreplyto = $message['from']; + $message['headers']['From'] = $properfrom; + $message['headers']['Reply-To'] = $properreplyto; +}
- admin's blog
- Login to post comments