When someone submits an email through the contact form, the email sent to the recipient addresses does not include the sender's email which makes it impossible to reply to their email. I am using the SMTP module if this makes any difference. It is impossible for me to use the PHP mail() function so I cannot test with that. If this is normal behavior or it is caused by the SMTP module, I apologize.

Comments

dingbats’s picture

Status: Active » Needs work
StatusFileSize
new1.22 KB
new937 bytes

I'm using the contact module for anonymous feedback and I ran into the same problem. I've attached two patches that put the sender's email address into the email body. For e.g. "John (john@example.com) has sent a..." instead of "John has sent a...".

I'm using Drupal. 5.7 and so have only tested the first patch (show_from_in_contact_email.patch) - the 6.1 patch (show_from_in_contact_email.patch-d6.patch) is yet untested.

josesanmartin’s picture

Version: 6.1 » 7.x-dev

+2

It's useful, useful, useful.

Tested this code in my 5.7 website and it's working nice.

Unfortunately this causes a string change and as far as I know it can't be commited before D7, right?

dries’s picture

Odd, in my case, I can just hit reply, and I'll send a reply to the sender of the message. It sounds like a bug in the SMTP module?

Would be good if we could intercept drupal_mail() so we could write a test for this ... :) Care to give that a try?

dingbats’s picture

It could also be an issue for those using Google SMTP.

Google's SMTP only allows From and Reply-To to be the email address of the account.

For example, if I authenticate myself as user@example.com, then I the From and Reply-To must be set to email via user@example.com.

If I want a different From or Reply-To address, this article may provide an answer.

In any case, those sites which have this problem are those using an SMTP server that doesn't allow setting an arbitrary From or Reply-To. This patch will be useful to them.

dave reid’s picture

Status: Needs work » Closed (won't fix)

This is a known problem with the SMTP module overwriting the email from value.

dingbats’s picture

Title: Sender's email address not included in email » Include sender's email address in the mail body
Version: 7.x-dev » 6.x-dev
Category: bug » task
Status: Closed (won't fix) » Needs review

Google's SMTP will rewrite the sender's email, so if there are enough people using Drupal with Google's SMTP, their concerns are worth looking into.

Dave Reid wrote:

This is a known problem with the SMTP module overwriting the email from value.

SMTP module may or may not overwrite, but even if it doesn't, Google would rewrite it, so why not put the sender's email in the mail body and guarantee that the recipient will have the sender's email address?

Here are some other voices in the crowd:

  1. http://lists.drupal.org/pipermail/support/2009-November/013395.html
  2. http://forum.webfaction.com/viewtopic.php?id=1784
  3. http://drupal.org/node/163223
  4. http://drupal.org/node/478980

The HEAD revision of contact.module currently has the sender's email in the mail body -- http://drupalcode.org/viewvc/drupal/drupal/modules/contact/contact.modul... -- why not do the same for Drupal 6?

dave reid’s picture

Status: Needs review » Closed (won't fix)

Since this would change strings this wouldn't be accepted for D6. You may be interested in the Contact 6.x-2.x alternate module which is a backport of the current core D7 module, which has this fix.

Anonymous’s picture

Successfully tested show_from_in_contact_email-d6.patch from #1 using Drupal 6.19.

Thank you.

dagmar’s picture

Take a look to: #607204: Cannot reply to emails sent via Gmail maybe it helps.