Page 1 of 2

Customers Email Not Coming Through in Contact Form

Posted: Fri Apr 13, 2018 1:08 am
by dragonturbo3
Not sure what caused this issue but if anyone can point me in the right area to fix it I would appreciate it.

When a customer uses the contact form to ask a question I get the users name but not their email. My own email comes through with their name.
Here is what the email looks like.
-------- Original Message --------
Subject: Enquiry Eric
From: Eric <info@casterracingparts.com>
Date: Tue, April 03, 2018 5:04 am
To: info@casterracingparts.com

Hi, I am considering purchasing a used nice condition Caster S10SC. I haven’t owned a Caster product before so I was wondering about parts availability. I noticed the truck itself is out of stock. Are all the parts still available if I were to need something? I looked through the parts listing but it seemed like some items weren’t listed. Is the truck still being produced or is it discontinued? Just afraid of buying something that I can’t get parts for if something were to break. Thanks for your time, Eric


As you can see the from line has the customers name but has my stores email address. And nowhere else is the customer's email. I thought maybe this was a onetime thing, but all customers that have used the contact form have come the same way.

I have looked through the forums for this as it seems like it would be a fairly common issue but could not find anything. Thanks in advance for any help.

Open Cart Version 3.0.2.0

Re: Customers Email Not Coming Through in Contact Form

Posted: Fri Apr 13, 2018 2:24 am
by JamSearch
I have the same problem exactly.

Re: Customers Email Not Coming Through in Contact Form

Posted: Fri Apr 13, 2018 4:56 pm
by paulfeakins
This is default OpenCart behaviour - if it sent from the customer's email address there would be a much higher chance of the email ending up in spam.

Re: Customers Email Not Coming Through in Contact Form

Posted: Sun Apr 15, 2018 2:06 am
by JamSearch
So is there a solution to the problem. Maybe another way of setting up the email? I'm a little lost here. I have tried several different settings and cannot get the correct results.

Re: Customers Email Not Coming Through in Contact Form

Posted: Tue Apr 17, 2018 12:21 am
by dragonturbo3
Thanks paulfeakins,
I understand that being sent from the carts address is necessary but in the contact form, it requests the customer's email address. But on the store owners end that email address is never relayed and therefore I have not been able to reply to any customer questions.

Re: Customers Email Not Coming Through in Contact Form

Posted: Tue Apr 17, 2018 3:01 pm
by JamSearch
I have been experimenting with the OpenCart software for a few weeks now and I think it's pretty great. It is a shame to have such a major bug that cannot be fixed. The contact page is useless. Why even have it? It works but you don't know who sent the message. ??? It defeats it's purpose.

Re: Customers Email Not Coming Through in Contact Form

Posted: Tue Apr 17, 2018 3:18 pm
by xxvirusxx
Yep, From email is read from oc setting

LE. To show customer email addres in "From" you need to edit:

Code: Select all

catalog/controller/information/contact.php
Delete or comment this line:

Code: Select all

$mail->setFrom($this->config->get('config_email'));
And change this line:

Code: Select all

$mail->setReplyTo($this->request->post['email']);
In this line

Code: Select all

$mail->setFrom($this->request->post['email']);
Also work if you have both line the same

Code: Select all

$mail->setFrom($this->request->post['email']);
$mail->setReplyTo($this->request->post['email']);

Re: Customers Email Not Coming Through in Contact Form

Posted: Tue Apr 17, 2018 11:13 pm
by dragonturbo3
Thanks xxvirusxx,
I am going to give this a shot now.

Re: Customers Email Not Coming Through in Contact Form

Posted: Tue Apr 17, 2018 11:20 pm
by dragonturbo3
xxvirusxx,
Before I do this it looks like the code will swap out the carts address for the customers in the from field, but is there any way to just have the customer's email show up in the body of the email?

Re: Customers Email Not Coming Through in Contact Form

Posted: Wed Apr 18, 2018 12:09 am
by ADD Creative
Looking at the code for 3.0.2.0. The reply to address is correctly set to the customer's email address. https://github.com/opencart/opencart/bl ... ct.php#L21

This seems the correct way of doing things. If you reply to the email, your email client should reply to the reply to address not the from address. Do you see the reply to address set correctly in the email headers?

Setting the from address as the customer's email address will cause problems if the customer's email domain has sender policy framework is set up correctly to fail messages sent from other servers. As your server won't be on the allowed list for the customer's email domain, any receiving mail server checking the SPF record could reject the email.

Re: Customers Email Not Coming Through in Contact Form

Posted: Wed Apr 18, 2018 1:44 am
by xxvirusxx
I don`t think is correctly...because when you compose an email you enter address only in "To:" field. When press reply will read automatically address from "From:" and isn`t necessary to have another field Reply-To...

oc 2.3.0.2 code

Re: Customers Email Not Coming Through in Contact Form

Posted: Wed Apr 18, 2018 7:40 pm
by ADD Creative
The customer's email was used in from field in the past. However this was found to cause problems with emails being rejected due to systems used to prevent email spoofing, such as Sender Policy Framework . This is why is was changed and the reply to field correctly added.

Providing you are correctly setting the reply to field, you email client should reply to the correct address.

Re: Customers Email Not Coming Through in Contact Form

Posted: Thu Apr 19, 2018 12:19 am
by JamSearch
Thank you so much xxvirusxx . Works great. That's all I needed.

Re: Customers Email Not Coming Through in Contact Form

Posted: Thu Apr 19, 2018 2:55 am
by JamSearch
...

Re: Customers Email Not Coming Through in Contact Form

Posted: Thu May 03, 2018 4:17 am
by Shortyme
Thank you xxvirusxx, I`ve read this topic and changed the lines like you said but no effect. Still have the same problem. Am I missing something ? It matters if I use a template other than the default one? I use outlook for email. I hope there is a solution to this matter because it is kind of annoying.

Re: Customers Email Not Coming Through in Contact Form

Posted: Thu May 03, 2018 5:35 am
by ADD Creative
The problem is actually seems due to Windows 10 Mail and some versions of Outlook wrongly ignoring the reply-to field. The workaround posted should work. Have you tried refreshing the modifications cache?

Re: Customers Email Not Coming Through in Contact Form

Posted: Fri May 04, 2018 12:40 am
by Shortyme
Hello,
I forgot to refresh the modification cache. Thanks for the tip ! :)
I will do more testing and see if I get through this.

LE: I flushed the cache and now I receive everything like it should !
Thank you guys, and good luck everyone with their projects !

Re: Customers Email Not Coming Through in Contact Form

Posted: Thu Sep 20, 2018 4:54 am
by lovenatural
Hi I have i think a similar problem with 3.0.2.
I am not receiving emails submitted via contact page.
When i am checking webmail records on server it shows undelivered email with this error:

"A message that you sent using the -t command line option contained no
addresses that were not also on the command line, and were therefore
suppressed. This left no recipient addresses, and so no delivery could
be attempted. "

I have tried the solution described here, and it did not help (yes caches cleared on browser and on modification as well).
Can you please help?

Re: Customers Email Not Coming Through in Contact Form

Posted: Thu Sep 20, 2018 8:05 pm
by ADD Creative
This thread is about working around in issue with some mail clients ignoring the reply to address.

You issue sounds like your server is not sending emails at all, which is likely a server configuration issue. What are your mail setting set to? So you get order notification emails to the admin email address?

Re: Customers Email Not Coming Through in Contact Form

Posted: Thu Sep 20, 2018 11:52 pm
by lovenatural
My hosting is hostgator. Mail settings set to
MAIL engine Mail
mail parameters: store@mydomainname.com
smtp user: store@mydomainname.com
tls://mydomainname.com
smtp port 465
smtp timeout 25

This is only settings that work for when people registered or lost password, they get the confirmation email or forgot password link. So yes server does sends out automatically generated emails for registration and for forgot password. But it turned out i just found out that contact us email is not being sent. The error i showed you i found in webmail. It looks like server is trying to send it, but it cant because according to this error it is looking for recipient address in the form and not finding it.