Jump to content

No Email's Being Sent to Customers


toast691
 Share

Recommended Posts

Good Morning. (Morning in Australia anyway)

Since upgrading to 6.1.7 customers have not received email updates in regard to their orders. We have still been getting order notifications to our admin email and the settings are correct in  Settings>store settings>Advanced

It is currently set up as PHP.. Previously it SMTP with SSL but it was the same with only admin getting emails.

Any ideas where to start looking?

Cheers

Stami

Link to comment
Share on other sites

As of a recent version, CubeCart now logs most, if not all, emails sent out.

If the Email Log shows messages sent to customers, then the loss is outside of CubeCart.

If the logs show a problem, or the emails are not logged at all, then we can start tracing down the problem.

 

Link to comment
Share on other sites

There have been no emails logged since 11th of July which is when I was playing around with email settings and used the test email option.

New orders come in every day and we have been getting emails to our admin email as I said but there is nothing in the log about them either.

I updated to 6.1.8 today with no change.

Stami

Link to comment
Share on other sites

Hmm. Even the emails sent to the admin get logged.

However, only proper emails will cause the log to be 'pruned' of entries older than 30 days. Which is to say, an email sent via the "Test" button on the Advanced tab does not get logged.

But, a test send of a newsletter will get logged. In Newsletters, Create Newsletter (if you haven't created one as of yet), enter some miscellaneous stuff. Then on the Send Test Email tab, enter an email that is not of your store's domain - such as a personal gmail account.

Let us know if you get it. See if it shows in the log.

 

Link to comment
Share on other sites

Just to verify that CubeCart has a log in the database, please use an external utility, such as phpMyAdmin, a tool in your hosting control panel, and verify there is a table named CubeCart_email_log. Have the utility show you the records contained within it.

Then, in your CubeCart installation, open the file /classes/mailer.class.php, scroll to near line 222, and verify there is code that deals with $log_days and the database table CubeCart_email_log.

Link to comment
Share on other sites

Yes CubeCart_email_log exists in the database and there were logs for customers up until 20th June 2017 mostly order updates and some password recovery.

In classes/mailer.class.php is the below code

$log_days = $GLOBALS['config']->get('config', 'r_email');
             if(ctype_digit((string)$log_days) &&  $log_days > 0) {
                $GLOBALS['db']->insert('CubeCart_email_log', $email_data);
                $GLOBALS['db']->delete('CubeCart_email_log', 'date < DATE_SUB(NOW(), INTERVAL '.$log_days.' DAY)');
            } elseif(empty($log_days) || !$log_days) {
                $GLOBALS['db']->insert('CubeCart_email_log', $email_data);

Link to comment
Share on other sites

I have tried changing to SMTP details and immediately there is a log of the following error:

Request Sent - mailto:[email protected] Subject: Testing CubeCart
Error: Mailer Failed
Response received SERVER -&gt; CLIENT: 421 Too many concurrent SMTP connections; please try again later.<br> CLIENT -&gt; SERVER: EHLO www.greenpatchseeds.com.au<br> SERVER -&gt; CLIENT: <br> SMTP ERROR: EHLO command failed: <br> SMTP NOTICE: EOF caught while checking if connected<br> SMTP Error: Could not authenticate.<br> SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
 
Maybe cubecart doesn't log when using the email set up as PHP?
Link to comment
Share on other sites

From the logic of this code, the value found in the Store Settings, Email Log Retention field would need to be either something that for every character looked like a digit, or was blank.

Assuming the execution of the code reached this point.

CubeCart's Mailer functions are used regardless whether one chooses PHP-Mail or SMTP. The Mailer communicates with the sending agent accordingly, but this is the code that initiates the email, populates its contents, and logs its departure out of CubeCart.

The error message you got would indicate that the email server your hosting provider uses is configured to allow only so many emails to be accepted for sending out server-wide, and that has been exceeded. So, either the server your site is located is overloaded, or one or more sites on that server is using more than its share of the server's email program (maybe Exim?) (From an internet search of 421 Too many concurrent SMTP connections.)

Edited by bsmither
Link to comment
Share on other sites

"Test newsletter sent to a personal hotmail address. The email was sent and showed up in my inbox."

So we know, basically, that your installation of CubeCart can send emails. The problem is apparently just not to the customer.

"Not showing up in the log though."

Here are some edits I would like for you to make. In /classes/mailer.class.php:

Line 208:
$this->Sender = $GLOBALS['config']->get('config', 'email_address');

On the blank line after that, add:
$GLOBALS['debug']->errorLogger(E_USER_NOTICE, 'Ready to email.', __FILE__, __LINE__);

Line 211:
$result = $this->Send();

On the same line, at the end of what is already there, add:
$GLOBALS['debug']->errorLogger(E_USER_NOTICE, 'Emailed.', __FILE__, __LINE__);

Lines 222-232:
            $log_days = $GLOBALS['config']->get('config', 'r_email');
             if(ctype_digit((string)$log_days) &&  $log_days > 0) {
            	$GLOBALS['db']->insert('CubeCart_email_log', $email_data);
            	$GLOBALS['db']->delete('CubeCart_email_log', 'date < DATE_SUB(NOW(), INTERVAL '.$log_days.' DAY)');
        	} elseif(empty($log_days) || !$log_days) {
        		$GLOBALS['db']->insert('CubeCart_email_log', $email_data);
        	}
            return $result;
		}

		return false;

Change to:
			$log_days = $GLOBALS['config']->get('config', 'r_email');
			if(ctype_digit((string)$log_days) &&  $log_days > 0) {$GLOBALS['debug']->errorLogger(E_USER_NOTICE, 'Logging with days > 0:'.$log_days, __FILE__, __LINE__);
				$GLOBALS['db']->insert('CubeCart_email_log', $email_data);
				$GLOBALS['db']->delete('CubeCart_email_log', 'date < DATE_SUB(NOW(), INTERVAL '.$log_days.' DAY)');
			} elseif(empty($log_days) || !$log_days) {$GLOBALS['debug']->errorLogger(E_USER_NOTICE, 'Logging with days empty.', __FILE__, __LINE__);
				$GLOBALS['db']->insert('CubeCart_email_log', $email_data);
			} else {$GLOBALS['debug']->errorLogger(E_USER_NOTICE, 'Not logged. Days has a problem:'.$log_days, __FILE__, __LINE__);}
			return $result;
		}
		$GLOBALS['debug']->errorLogger(E_USER_NOTICE, 'Failed to parse contents. Returning false.', __FILE__, __LINE__);
		return false;

Either make another Newsletter test email send, or wait until a customer makes an order. Then examine the Mail Log, and also examine the System Error Log

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...