Hi everyone. Apologies if this has been answered before but I wasn't able to find a solution.
When someone fills out the contact form on our webstore, the enquiry email address comes through as being from their email address. Can someone tell me how I can change this so that the sender is address is instead enquiries@mydomain.com?
I would also need their email address adding to the email body, too. OC Version 2.3.0.2
Thanks
When someone fills out the contact form on our webstore, the enquiry email address comes through as being from their email address. Can someone tell me how I can change this so that the sender is address is instead enquiries@mydomain.com?
I would also need their email address adding to the email body, too. OC Version 2.3.0.2
Thanks
Google: viewtopic.php?t=203601
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
OK I've found my own solution. If anyone is interested:
Edit: catalog/controller/information/contact.php
To send contact form enquiries from a specific address instead of the customer's, change this line:
to
To include the customer's email address in the message body, change this line:
to
Edit: catalog/controller/information/contact.php
To send contact form enquiries from a specific address instead of the customer's, change this line:
Code: Select all
$mail->setFrom($this->request->post['email']);
Code: Select all
$mail->setFrom("enquiries@yourdomain.com");
Code: Select all
$mail->setText($this->request->post['enquiry']);
Code: Select all
$mail->setText("Customers Name: ".$this->request->post['name']."\n"."Customers Email: ".$this->request->post['email']."\n"."Message:".$this->request->post['enquiry']);
However, your last post differs from the topic's subject title which the provided link above was referring to. Now that the issue has been solved, please add: [SOLVED] at the beginning of the subject line on your first post.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
I was having very similar problems. When using my hoster's SMTP server it took me awhile but I finally figured out how to make it work for my situation. Maybe some, or all, of these changes and settings might work for you.
1) In the OpenCart System > Settings > Mail tab
SMTP Hostname: ssl://smtp.yourhost.com
You have to put ssl:// before the server hostname:
2) My hoster SMTP system DOES NOT allow the email "From" or "Reply To" fields to be anything but the domain email address that you are using. By domain email address I mean the email address you have designated in the OpenCart System > Settings > Mail tab.
You also may have to change the contact.php file in 2 different locations. The paths for these files are as follows:
[root]/storage/modification/catalog/controller/information/contact.php
[root]/[domainname]/catalog/controller/information/contact.php
Change these lines:
$mail->setFrom($this->request->post['email']);
$mail->setReplyTo($this->request->post['email']);
$mail->setText($this->request->post['enquiry']);
To this:
$mail->setFrom($this->config->get('config_email'));
$mail->setReplyTo($this->config->get('config_email'));
$mail->setText("Customers Name: ".$this->request->post['name']."\n"."Customers Email: ".$this->request->post['email']."\n"."Message:".$this->request->post['enquiry']);
What you are doing is replacing the customer email address, that was being set in the From and Reply fields, to your email. Then, in order to know what your customer's email address is, we are adding some lines to the message body to include the customer name, email address, and the message they wrote to you.
Hope this helps!
1) In the OpenCart System > Settings > Mail tab
SMTP Hostname: ssl://smtp.yourhost.com
You have to put ssl:// before the server hostname:
2) My hoster SMTP system DOES NOT allow the email "From" or "Reply To" fields to be anything but the domain email address that you are using. By domain email address I mean the email address you have designated in the OpenCart System > Settings > Mail tab.
You also may have to change the contact.php file in 2 different locations. The paths for these files are as follows:
[root]/storage/modification/catalog/controller/information/contact.php
[root]/[domainname]/catalog/controller/information/contact.php
Change these lines:
$mail->setFrom($this->request->post['email']);
$mail->setReplyTo($this->request->post['email']);
$mail->setText($this->request->post['enquiry']);
To this:
$mail->setFrom($this->config->get('config_email'));
$mail->setReplyTo($this->config->get('config_email'));
$mail->setText("Customers Name: ".$this->request->post['name']."\n"."Customers Email: ".$this->request->post['email']."\n"."Message:".$this->request->post['enquiry']);
What you are doing is replacing the customer email address, that was being set in the From and Reply fields, to your email. Then, in order to know what your customer's email address is, we are adding some lines to the message body to include the customer name, email address, and the message they wrote to you.
Hope this helps!
If your SMTP is not sending form the contact form, try this:
In both file locations:
[root]/storage/modification/catalog/controller/information/contact.php
[root]/[domainname]/catalog/controller/information/contact.php
Change the "Sent From" variable
To this:
Change "Repy To" variable:
To this:
And change the Message text:
To this (this puts the customers name and email address in the body of the message):
In both file locations:
[root]/storage/modification/catalog/controller/information/contact.php
[root]/[domainname]/catalog/controller/information/contact.php
Change the "Sent From" variable
Code: Select all
$mail->setFrom($this->request->post['email']);
Code: Select all
$mail->setFrom($this->config->get('config_email'));
Code: Select all
$mail->setReplyTo($this->request->post['email']);
Code: Select all
$mail->setReplyTo($this->config->get('config_email'));
Code: Select all
$mail->setText($this->request->post['enquiry']);
Code: Select all
$mail->setText("Customers Name: ".$this->request->post['name']."\n"."Customers Email: ".$this->request->post['email']."\n"."Message:".$this->request->post['enquiry']);
Hi, thank you to everyone who contributes to these forums. I would appreciate any help on a similar matter.
For some reason every time a message comes through via the contact form it only displays my email address as the sender. It does not show who sent the request. I do not know how to fix and I am very noob in all things opencart. I am using a recent install of oc 2.3 in order to use some modules which are not available in the 3.0 onward so prob will not upgrade.
additional info
dashboard - system settings - mail
Mail protocol = SMTP
Mail Parameters = "forders@mystite.com"
SMTP Hostname = ss\:serverxxxxxxxxxxxxxxx
SMTP Username = orders@mystite.com
orders@mystite.com is my email
i have prefixed the letter f to my email for above mail parameters field as suggested
how do if fix this? also how do i disable the constant spam. it bleeds through even if i enable basic captcha.
any way thank you in advance.
For some reason every time a message comes through via the contact form it only displays my email address as the sender. It does not show who sent the request. I do not know how to fix and I am very noob in all things opencart. I am using a recent install of oc 2.3 in order to use some modules which are not available in the 3.0 onward so prob will not upgrade.
additional info
dashboard - system settings - mail
Mail protocol = SMTP
Mail Parameters = "forders@mystite.com"
SMTP Hostname = ss\:serverxxxxxxxxxxxxxxx
SMTP Username = orders@mystite.com
orders@mystite.com is my email
i have prefixed the letter f to my email for above mail parameters field as suggested
how do if fix this? also how do i disable the constant spam. it bleeds through even if i enable basic captcha.
any way thank you in advance.
The emails you receive should have the Reply-To header set in them. View the raw email headers to see if it's there.pcwhosting wrote: ↑Fri Sep 06, 2024 7:22 pmHi, thank you to everyone who contributes to these forums. I would appreciate any help on a similar matter.
For some reason every time a message comes through via the contact form it only displays my email address as the sender. It does not show who sent the request. I do not know how to fix and I am very noob in all things opencart. I am using a recent install of oc 2.3 in order to use some modules which are not available in the 3.0 onward so prob will not upgrade.
additional info
dashboard - system settings - mail
Mail protocol = SMTP
Mail Parameters = "forders@mystite.com"
SMTP Hostname = ss\:serverxxxxxxxxxxxxxxx
SMTP Username = orders@mystite.com
orders@mystite.com is my email
i have prefixed the letter f to my email for above mail parameters field as suggested
how do if fix this? also how do i disable the constant spam. it bleeds through even if i enable basic captcha.
any way thank you in advance.
Who is online
Users browsing this forum: No registered users and 16 guests