Page 1 of 1
Mail setup with Godaddy
Posted: Thu Oct 05, 2017 12:11 am
by beerlim
The contact form works and I get the email
But when a user registers, there is no notification
Is there a bug?
Re: Mail setup with Godaddy
Posted: Thu Oct 05, 2017 12:59 am
by straightlight
Which OC version are you using and what is the notification message that you see? If you're using a custom theme, switch back to the default theme and see if the same issue gets replicated.
Re: Mail setup with Godaddy
Posted: Fri Oct 06, 2017 12:44 am
by beerlim
OC version V3.0.2.0 , no custom them, its the default.
"I do not see a notification message" meaning when I test purchase a product on the very end it tells you (the customer) that you will get an email. Well I do not.
Re: Mail setup with Godaddy
Posted: Fri Oct 06, 2017 1:11 am
by straightlight
Set the HTML email options from the admin - > system - > settings - > mail tab to text emails and see if you can replicate the problem in this format. The contact email may send emails in text mode versus HTML which is why it may be working normally.
Re: Mail setup with Godaddy
Posted: Fri Oct 06, 2017 1:20 am
by beerlim
I do not have that option under Mail Tab in Settings.
Re: Mail setup with Godaddy
Posted: Fri Oct 06, 2017 1:38 am
by straightlight
For some reason ... the mail HTML method seem to be insisted in v3.0.2.0 release. Let's try the following tweak.
In catalog/controller/mail/order.php file,
find:
Code: Select all
$mail->setHtml($this->load->view('mail/order_add', $data));
replace with:
Code: Select all
$mail->setText($this->load->view('mail/order_add', $data));
Refill a test order and see if you can receive a text email message.
Re: Mail setup with Godaddy
Posted: Fri Oct 06, 2017 1:47 am
by beerlim
that did not do the trick. I am assuming I should be getting an email as the customer, correct?
All I see at the end of the order process:
Your order has been placed!
Your order has been successfully processed!
You can view your order history by going to the my account page and by clicking on history.
If your purchase has an associated download, you can go to the account downloads page to view them.
Please direct any questions you have to the store owner.
Thanks for shopping with us online!
Re: Mail setup with Godaddy
Posted: Fri Oct 06, 2017 3:55 am
by straightlight
Have you checked your SPAM filter as well?
Re: Mail setup with Godaddy
Posted: Fri Oct 06, 2017 10:32 am
by beerlim
Nothing in spam folder.
I just did another test. Used the online 'Contact Us' form. Email arrived in less then 1min.
Test2: Registered as a customer
here the feedback on the screen, the email never makes it. So there must be differences between Contact Us form and registering as a customer.
One other thought: the code you had me change, a few lines above it looks a lot like smtp, but I use php mail in my settings.
Your Account Has Been Created!
Congratulations! Your new account has been successfully created!
You can now take advantage of member privileges to enhance your online shopping experience with us.
If you have ANY questions about the operation of this online shop, please e-mail the store owner.
A confirmation has been sent to the provided e-mail address. If you have not received it within the hour, please contact us.
Re: Mail setup with Godaddy
Posted: Fri Oct 06, 2017 7:02 pm
by straightlight
It may be possible that GoDaddy may restrict HTML email headers or may be customized as opposed to what Opencart uses. Yesterday, I've been working on a tweak about email headers with restricted providers for testing purposes. Let's try this:
1 - Put your site under maintenance.
2 - Download PHPMailer at:
https://sourceforge.net/projects/phpmai ... t/download
3 - From the downloaded ZIP file, upload the _lib/class.phpmailer.php file to your Opencart's system/library/mail/PHPMailer folder (create the folder).
4 - In system/library/mail/PHPMailer/class.phpmailer.php file,
find:
add right
below:
Then, find:
Code: Select all
function Sign($cert_filename, $key_filename, $key_pass) {
$this->sign_cert_file = $cert_filename;
$this->sign_key_file = $key_filename;
$this->sign_key_pass = $key_pass;
}
add below:
Code: Select all
/**
*
*
* @param mixed $to
*/
function setTo($to) {
return $to;
}
/**
*
*
* @param string $from
*/
function setFrom($from) {
return $from;
}
/**
*
*
* @param string $sender
*/
function setSender($sender) {
return $sender;
}
/**
*
*
* @param string $reply_to
*/
function setReplyTo($reply_to) {
return $reply_to;
}
/**
*
*
* @param string $subject
*/
function setSubject($subject) {
return $subject;
}
/**
*
*
* @param string $text
*/
function setText($text) {
return $text;
}
/**
*
*
* @param string $html
*/
function setHtml($html) {
return $html;
}
function Log($filename) {
$this->handle = fopen(DIR_LOGS . $filename, 'a');
return $this->handle;
}
function write($message) {
fwrite($this->handle, date('Y-m-d G:i:s') . ' - ' . print_r($message, true) . "\n");
fclose($this->handle);
}
5 - In system/library/mail/smtp.php file,
replace the entire file with:
Code: Select all
<?php
namespace Mail;
require_once(DIR_SYSTEM . 'library/mail/PHPMailer/class.phpmailer.php');
class Smtp {
public $smtp_hostname;
public $smtp_username;
public $smtp_password;
public $smtp_port = 25;
public $smtp_timeout = 5;
public function send() {
try {
$PHPMailer = new PHPMailer(true);
$PHPMailer->IsSMTP();
$PHPMailer->SMTPDebug = 2;
$PHPMailer->Host = $this->smtp_hostname;
$PHPMailer->SMTPAuth = true;
$PHPMailer->Port = $this->smtp_port;
$PHPMailer->Username = $this->smtp_username;
$PHPMailer->Password = $this->smtp_password;
$PHPMailer->CharSet = 'UTF-8';
$PHPMailer->IsHTML(true);
$PHPMailer->ContentType = 'text/html; charset=utf-8\r\n';
$PHPMailer->Mailer = 'smtp';
$PHPMailer->SetFrom($this->from, $this->sender);
if ($this->reply_to) {
$PHPMailer->AddReplyTo($this->reply_to, $this->reply_to);
}
$PHPMailer->Subject = $this->subject;
if ($this->text) {
$PHPMailer->AltBody = $this->text;
}
if ($this->html) {
$PHPMailer->MsgHTML($this->text);
}
$PHPMailer->Send();
} catch (phpmailerException $e) {
$PHPMailer->write('PHPMailer: ' . $e->errorMessage());
} catch (Exception $e) {
$PHPMailer->write($e->getMessage());
}
}
}
6 - Ensure that your admin email configurations are properly configured.
7 - Test your emails and check the logs in the admin to see if you notice new activities with your emails.
Re: Mail setup with Godaddy
Posted: Fri Oct 06, 2017 7:47 pm
by beerlim
How do I test point 7?
I have everything in place now.
What I did is:
- get out of maintenance mode
- My Account - Register and signed up.
--> no emails, no logs in System - Maintenance - Error Logs
Re: Mail setup with Godaddy
Posted: Sun Oct 08, 2017 3:49 am
by beerlim
I did another test
I deleted register.php and order.php , placed an order and registered as a customer
I did not even get an error. Are we accessing the right location on opencart?
Re: Mail setup with Godaddy
Posted: Sun Oct 08, 2017 4:09 am
by straightlight
Hi,
send me a PM. I will take a look at this issue.
Re: Mail setup with Godaddy
Posted: Mon Oct 09, 2017 12:43 pm
by tonkp
I do not have that option in the Mail Settings tab.
sbobet
Re: Mail setup with Godaddy
Posted: Sun Oct 15, 2017 1:39 pm
by beerlim
Just to follow up on this issue. I am not sure my PM is going through, so I am posting here again.
I did a session with an OC specialist and we could not get it going yet.
I did contact godaddy TS and we dropped a php file into the OC folder and called it and voila the email worked with that php script, which makes me believe its in the OC code. Maybe Godaddy is sensitive that everything is correct or has a bug that OC did not compensate for (but others WP, Joomla, Webtrees have) and that is why the notification email are not going through.
Re: Mail setup with Godaddy
Posted: Sun Oct 15, 2017 7:47 pm
by straightlight
I did received your PM and replied to it. Although, you sent it in the middle of the night which is why I could not reply on a short-time basis.
Re: Mail setup with Godaddy
Posted: Thu Oct 19, 2017 1:28 am
by straightlight
This issue has now been resolved. To next users seeing this topic, ensure that the upgrade procedure of Opencart are not impacting the events table.
Re: Mail setup with Godaddy
Posted: Thu Oct 19, 2017 1:29 am
by beerlim
Finally someone found the bug:)
It is an upgrade bug from OC 2.x. The event table is empty.
So follow this topic and email should be flowing
viewtopic.php?f=199&t=186236&p=681186&h ... ls#p681622
Re: Mail setup with Godaddy
Posted: Wed Apr 04, 2018 3:17 am
by Leoden
greetings,
if you are using godaddy shared webhosting, here is a solution
https://foxrig.com/opencart-support