Dear Community,

When some one (authenticated user or anonymous user) uses the site wide contact form, I do get the email, however, the email does not include the value entered in the email field (for anonymous user).. It only includes the subject, Name, and the Message. The problem is I cannot contact the anonymous users as I don't get their email address that they entered while submitting the form. Is the a way i can fix it.

Thanks,

-Nabil.

Comments

Ron Chandy’s picture

Many web hosting companies do not allow 'nobody' emails and in return either replace the email field with the server root email address or just leave it blank. This they say is to stop spaming.

Change your hosting company or talk to your hosting company.

Best of Luck
Ron

ksargent’s picture

I'm using gmail for smtp and all my domain email. I don't think it's a host issue, since the smtp modules I listed connects to gmail to send the messages.

I need a solution to print / display the email address in the body of the message & I don't know anything about the contact module or the email system in drupal.

thanks

namalik’s picture

Correct , that is the problem.. The email received does not include the email address of the anonymous user that he/she entered in the site-wide contact form before submitting the form.

namalik’s picture

May be my message was not clear!

I am getting the emails, however, i want the the contact module to include in the email body (of the email that I receive) the email address entered by the anonymous user in the form before submitting the form. This will enable me to contact back the anonymous user.

EkaMei’s picture

I'm getting the same problem, when someone enters their e-mail in the contact form and when I recieves that e-mail. It does not includes the contact sender's e-mail address.

Kinda defeat the purpose of them entering their e-mail...

Ron Chandy’s picture

Hello

I had this nasty problem. and I found that the module "htmlmail" was creating problem. I uninstalled it and everything was okay. Though it was difficult but I uninstalled all modules and kept checking by enabling few modules each step. Try it out this could help.

Ron

EkaMei’s picture

I uninstall "Messaging PHPMailer" which seem like the only thing that have to do html mail.

"Mail Sending Method: Integration with PHPMailer for HMTL Mail"

Though that doesn't seem to help.

anilo’s picture

I don't have htmlmail installed - and I am using SMTP settings to send emails via GMAIL.

The email is received with the sender's name but the email address is not received.

Any pointers would help.

anilo’s picture

This is such a basic piece of core code that it should've been addressed by now.

My solution for now is: Edit the file /modules/contact/contact.module

Change the line under the function contact_mail()

From:

$message['body'][] = t("!name sent a message using the contact form at !form.", array('!name' => $params['name'], '!form' => url($_GET['q'], array('absolute' => TRUE, 'language' => $language))), $language->language);

To:

$message['body'][] = t("!name (!mail) sent a message using the contact form at !form.", array('!name' => $params['name'], '!mail' => $params['mail'], '!form' => url($_GET['q'], array('absolute' => TRUE, 'language' => $language))), $language->language);

That's it !!!

Email addresses will appear now.

-Anil

EkaMei’s picture

This is a life saver... I was going to try reinstall my test site from sketch to try fix this issue.

Yes, I agree, this really should be addressed. While it is simple it is unnecessarily complicated to fix.

natuk’s picture

Has anybody submitted a new issue about this?

namalik’s picture

Earlier, i had hosted my website on my local machine, and i was using gmail smtp for sending email messages. The contact form contacts the gmail smtp to send email, but requests that the from address has the email address that was entered in the contact form itself. Now, gmail does not allow this, and forces to used the email address/user account that was used to authenticate during smtp communication. In the end, the email reaches the destination, however, the from header is the gmail user name/email that was used for authentication between my local smtp and gmail smtp.

Well, later on, when if relocate my site from my local machine to a hosting provide that had its own email system (smtp), the emails sent through the contact form are working fine. All email received have the email address of the user that filled the form and his email address in the form.

Good Luck.