Zen Cart Logo
Forums / General Questions / E-mails not working

E-mails not working

Locked

Views: 3,888

Results 1 to 20 of 22
This thread is locked. New replies are disabled.
2 Aug 2007, 6:37 PM
#1
danallkins avatar

danallkins

Zen Follower

Join Date:
Aug 2006
Posts:
135
Plugin Contributions:
0

E-mails not working

Hi,

I have been informed by mate that his email isn't working in zen cart. He is unable to send out emails for newsletters etc..

When her tries this is what he gets:

1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':admin_id' at line 1
in:
[select 'ADMIN' as customers_firstname, admin_name as customers_lastname, admin_email as customers_email_address from zen_admin where admin_id = $SESSION:admin_id ]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

Short of having to reinstall zen cart, which isn't going to be easy due to all the add ons and customizing done, is there anything I can do??

Any help would be great,

Thanks

Dan

2 Aug 2007, 8:36 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: E-mails not working

Sounds like he's installed an outdated addon or has done an incomplete site upgrade.

Check that his /includes/functions/audience.php file is up to date with his Zen Cart version.

2 Aug 2007, 8:52 PM
#3
danallkins avatar

danallkins

Zen Follower

Join Date:
Aug 2006
Posts:
135
Plugin Contributions:
0

Re: E-mails not working

I get a 403 when trying to view it from a broswer.

2 Aug 2007, 8:53 PM
#4
danallkins avatar

danallkins

Zen Follower

Join Date:
Aug 2006
Posts:
135
Plugin Contributions:
0

Re: E-mails not working

Just spoke ti him, he said he thinks he did a database update a while ago.

3 Aug 2007, 12:32 PM
#5
chuckl avatar

chuckl

Totally Zenned

Join Date:
Nov 2006
Location:
Papworth, Cambridgeshire, UK
Posts:
717
Plugin Contributions:
0

Re: E-mails not working

Has the site been moved to a new server recently, or the server software updated/changed?
This sounds like a sessions problem on the server, or out of date cached data. Could also be a very old Mysql version, but thats unlikely.

Check Admin-Tools-Server/Version info for the installed versions, and scroll down to the 'sessions' section for sessions settings.
You could also disable any caching in the configure.php files to see if that helps.

3 Aug 2007, 6:32 PM
#6
danallkins avatar

danallkins

Zen Follower

Join Date:
Aug 2006
Posts:
135
Plugin Contributions:
0

Re: E-mails not working

this is what it says in the server/ version for sessions:

session
Session Support enabled
Registered save handlers files user

3 Aug 2007, 7:01 PM
#7
chuckl avatar

chuckl

Totally Zenned

Join Date:
Nov 2006
Location:
Papworth, Cambridgeshire, UK
Posts:
717
Plugin Contributions:
0

Re: E-mails not working

Server moves/updates/changes?
Zen Cart, PHP, MySql versions?

3 Aug 2007, 7:56 PM
#8
danallkins avatar

danallkins

Zen Follower

Join Date:
Aug 2006
Posts:
135
Plugin Contributions:
0

Re: E-mails not working

No server changes/ updates or moves.
ZenCart 1.3.0.1
PHP 4.4.7
MySql 5.0.24a

4 Aug 2007, 6:06 AM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: E-mails not working

The query you mentioned in your first post didn't exist until v1.3.0.2.
If you're using v1.3.0.1, then I'm not surprised that you're getting errors.
Also keep in mind that a LOT of bugs have been fixed since v1.3.0.1 ... it's worth upgrading ...

4 Aug 2007, 12:45 PM
#10
danallkins avatar

danallkins

Zen Follower

Join Date:
Aug 2006
Posts:
135
Plugin Contributions:
0

Re: E-mails not working

DrByte:

The query you mentioned in your first post didn't exist until v1.3.0.2.
If you're using v1.3.0.1, then I'm not surprised that you're getting errors.
Also keep in mind that a LOT of bugs have been fixed since v1.3.0.1 ... it's worth upgrading ...

All taken in, Thanks DrByte, I'm going to do a upgrade and sort it out that way... Probably the best thing to do.

Thanks for the help

Dan

6 Aug 2007, 6:44 AM
#11
axol avatar

axol

New Zenner

Join Date:
Aug 2007
Posts:
13
Plugin Contributions:
0

Re: E-mails not working

Chuckl:

Has the site been moved to a new server recently, or the server software updated/changed?
This sounds like a sessions problem on the server, or out of date cached data. Could also be a very old Mysql version, but thats unlikely.

Check Admin-Tools-Server/Version info for the installed versions, and scroll down to the 'sessions' section for sessions settings.
You could also disable any caching in the configure.php files to see if that helps.

Hi,

Sorry to snoop on your replies but I am having the same problem sort of. I moved my Zencart from https://www.domain.com.au/cart to https://www.domain.com.au and the emails arent working anymore. Customers can send me emails from contact us section but no emails are sent when they register and/or their orders are updated. I have changed the sessions setting but I really dont no what else to do.

Any help would be greatly appreciated.

Thanks

6 Aug 2007, 7:30 AM
#12
chuckl avatar

chuckl

Totally Zenned

Join Date:
Nov 2006
Location:
Papworth, Cambridgeshire, UK
Posts:
717
Plugin Contributions:
0

Re: E-mails not working

Axol, The problem Dan was getting was related to an SQL query and the Sessions data, hence the suggestion about settings.
Your description suggests that emails to 'local' email addresses - like [email protected] are being delivered, while 'external' ones like customers email addresses are not.
I would suggest that you enable email archiving - Admin-Configuration-Email Options, and send a test email from admin. Then check the email_archive table in your database, using PHPmyAdmin or similar to see whether it has been archived.
Since the archiving occurs after the email is 'sent' this would suggest that all is well with your site move, if not, you probably have a permissions setting wrong on a folder somewhere, config error, or not all files have been moved correctly.
If all is well with the archiving, then I would suspect a server config problem, again permissions, or a wider problem with your domain mail config.

6 Aug 2007, 7:51 AM
#13
axol avatar

axol

New Zenner

Join Date:
Aug 2007
Posts:
13
Plugin Contributions:
0

Re: E-mails not working

Thanks for your responce Chuckl. I have enabled archiving and all the emails are showing up, internal and external, yet only the internal onces are reaching their targets. Any other ideas I might be able to try before I have to involve the hosting company since they arent the most helpful bunch of nerds :)

6 Aug 2007, 8:11 AM
#14
chuckl avatar

chuckl

Totally Zenned

Join Date:
Nov 2006
Location:
Papworth, Cambridgeshire, UK
Posts:
717
Plugin Contributions:
0

Re: E-mails not working

If the emails are archived and look ok in the archive then the Zen Cart software 'believes' that the mail has been sent, as all it does is create the mail and pass it on to a mail server for delivery.
I suggest that you visit https://www.dnsstuff.com and do a dnsreport on your domain - mydomain.com.au, no www, and see if there are any large red errors flagged, particularly with regard to the mail setup. You should also check the listed mail servers for your domain in the report.
Most problems, particularly with the free services - yahoo, hotmail,gmail etc are caused by things that will be flagged there.
If that all looks good, then you'll have to ask your hosting co. to check the mail logs to see what they think has happened to your mail.

6 Aug 2007, 8:39 AM
#15
axol avatar

axol

New Zenner

Join Date:
Aug 2007
Posts:
13
Plugin Contributions:
0

Re: E-mails not working

Chuckl:

If the emails are archived and look ok in the archive then the Zen Cart software 'believes' that the mail has been sent, as all it does is create the mail and pass it on to a mail server for delivery.
I suggest that you visit https://www.dnsstuff.com and do a dnsreport on your domain - mydomain.com.au, no www, and see if there are any large red errors flagged, particularly with regard to the mail setup. You should also check the listed mail servers for your domain in the report.
Most problems, particularly with the free services - yahoo, hotmail,gmail etc are caused by things that will be flagged there.
If that all looks good, then you'll have to ask your hosting co. to check the mail logs to see what they think has happened to your mail.

Thanks again. No errors flagged regarding mail. Name servers are set to ns1 and ns2.mydomain.com.au. I have been sending mail to 2 of Australias major ISP's and also hotmail and yahoo and none of them have worked. Looks like I have to ask the hosting co unless you have any other things I can try? :)

6 Aug 2007, 9:05 AM
#16
chuckl avatar

chuckl

Totally Zenned

Join Date:
Nov 2006
Location:
Papworth, Cambridgeshire, UK
Posts:
717
Plugin Contributions:
0

Re: E-mails not working

The no errors flagged is a good start, means there is nothing severely negative in the setup.
An increasingly common problem I'm seeing is that the mail is being sent out from your site by your hosting companies mail servers but that they are not listed as 'sending mail servers' for your domain in an SPF record. This will almost certainly doom any mail from the site to the spam or delete folders.
i.e. Your site https://www.mydomain.com.au is correctly set up, but the emails are being sent out by mail576.awfullybighosting.com.au. Instant Spam flag.
If any of the external email addresses you mentioned are your own test addresses/friends etc, check the spam folders.

I'd say you need to contact your hosts, outline the problem, and specifically ask for the mail logs to be checked, to see if the receiving mail servers are outright rejecting or deferring the mail.
Unfortunately, in an ecommerce/online store type environment, there is often nowhere for the bounced mail report to go.
If there's nothing in the logs, it is a problem in the site to mail server setup.

There is also the usual, make sure that 'send from known domain' is set to true, the email transport is set to what the hosting co recommends etc.

6 Aug 2007, 9:22 AM
#17
axol avatar

axol

New Zenner

Join Date:
Aug 2007
Posts:
13
Plugin Contributions:
0

Re: E-mails not working

Chuckl:

The no errors flagged is a good start, means there is nothing severely negative in the setup.
An increasingly common problem I'm seeing is that the mail is being sent out from your site by your hosting companies mail servers but that they are not listed as 'sending mail servers' for your domain in an SPF record. This will almost certainly doom any mail from the site to the spam or delete folders.
i.e. Your site https://www.mydomain.com.au is correctly set up, but the emails are being sent out by mail576.awfullybighosting.com.au. Instant Spam flag.
If any of the external email addresses you mentioned are your own test addresses/friends etc, check the spam folders.

I'd say you need to contact your hosts, outline the problem, and specifically ask for the mail logs to be checked, to see if the receiving mail servers are outright rejecting or deferring the mail.
Unfortunately, in an ecommerce/online store type environment, there is often nowhere for the bounced mail report to go.
If there's nothing in the logs, it is a problem in the site to mail server setup.

There is also the usual, make sure that 'send from known domain' is set to true, the email transport is set to what the hosting co recommends etc.

Thanks. The funny thing is though, before I moved the files, the emails where working perfectly. Everything else is working fine, its just its a pain in the ###### regarding the emails. This is why im thinking it is a configuration issue.

A have another hosting account so I might xfer the site over so I can wipe and start over again on the current hosting compnay.

Thanks for your help though. Much appreciated.

6 Aug 2007, 9:51 AM
#18
chuckl avatar

chuckl

Totally Zenned

Join Date:
Nov 2006
Location:
Papworth, Cambridgeshire, UK
Posts:
717
Plugin Contributions:
0

Re: E-mails not working

I wouldn't get too inventive on more moving/relocating just yet, better to track down the problem.
As I mentioned earlier, you could still have a config type problem, caused indirectly by the move. If your hosting environment is using SuExec or SuPHP, very subtle crashes can occur if the folder permissions are not exactly right. If this happens deep down in the sub folders, you may well not see an error message, or it can flash up so briefly that it is easily missed.
That is why the mail logs are important. They reveal whether the mail was accepted from your site by the host mail server, and whether it was successfully sent on down the line.

6 Aug 2007, 11:28 PM
#19
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: E-mails not working

Axol:

Thanks. The funny thing is though, before I moved the files, the emails where working perfectly. Everything else is working fine, its just its a pain in the ###### regarding the emails. This is why im thinking it is a configuration issue.How exactly did you change folders? What exact steps did you follow to get from "then" to "now"?

7 Aug 2007, 1:10 AM
#20
axol avatar

axol

New Zenner

Join Date:
Aug 2007
Posts:
13
Plugin Contributions:
0

Re: E-mails not working

DrByte:

How exactly did you change folders? What exact steps did you follow to get from "then" to "now"?

Thanks for your reply. I followed all the steps layed out in the below FAQ entry.

https://www.zen-cart.com/tutorials/index.php?article=122