2

Have just moved a site live. But no emails are coming through.

No CartThrob order confirmations. I have tried sendmail and phpmail. I have also tried both sendmail and phpmail and just sending from the CP with the 'communicate' feature.

With email debugging on the CP says everything is fine:

Your email has been sent. Your message has been successfully sent using the following protocol: sendmail

CartThrob on the front end throws an error at the point it wants to send an order confirmation and says to turn email debug off.

Where do I start looking? This client doesn't use email with there webhost, they use Google apps - not sure if that matters?

7

A couple of things to check:

  1. Make sure that you're not sending confirmations to and from the same address with a Google-hosted email address. It will often discard such messages automatically.
  2. CartThrob just recently added a "Reply-to" field for notifications - use that for the customer's email ({email}), and use a different address on the same domain in the "From" field (for example, if your admin order confirmations are being sent to orders@mywebsite.com, set the "From" field to noreply@mywebsite.com). Google is getting very strict about messages sent with a "From" header that is a Google-hosted email domain but that does not go through their SMTP. Using this "Reply-to" trick seems to help.

Failing that, you may want to look at using a service like Postmark, which has an SMTP option that should work with EE (set it up in your Email Configuration preferences).

| improve this answer | |
  • +1 for Postmark, great for debugging. – Richard Frank Nov 29 '12 at 16:01
2

I agree with @Derek Hogue, start with making sure the send and receive email addresses are different. I'd also look at what might be different via the two servers. I've had to switch to SMTP mail for a few ISP.

If the SMTP option is available, give that a try, using the Google Apps login details.

| improve this answer | |
  • Put smtp.gmail.com and username and password into "email configuration" of EE CP. Still nothing through. The email setups in EE/CT are identical. It must be an ISP issue, surely? – Mike Dexter Nov 29 '12 at 15:31
1

Sending email from web servers is often fraught with problems, especially if you're on a shared IP. Many times IPs get blacklisted by spam filters and prevent emails from going. Of course, it could also just be a configuration issue on the server.

Generally, to avoid all of this mess, I create an email account for the website and set the SMTP settings in ExpressionEngine to use that account to send, thus avoiding any local mail delivery issues.

| improve this answer | |
1

If EE is consistently failing to send emails it's worth checking whether or not you can trigger emails via direct calls to mail(). Add the code snippet below to a test PHP file or PHP-enabled EE template and see if you receive anything:

<?php

if (mail('you@yourdomain.com', 'Quick email test', 'Is this on?'))
{
    echo 'Mail sent successfully.';
}
else
{
    echo 'Mail was not sent.';
}

If that doesn't generate anything then try entering a secondary email address. If that doesn't generate anything then it's likely your server configuration is the issue. If the second test works then you know that your email provider is the culprit (maybe it's bouncing the emails back as spam).

| improve this answer | |
  • » I tried 3 different email accounts (all on google apps, mind you) and nothing came through. I just dropped that code of yours in a blank file and changed out the email address. – Mike Dexter Nov 29 '12 at 15:46
  • It sounds pretty likely that the server configuration is the problem. I've just updated my post with a some slightly more useful test code which you might like to try. I'd suggest trying a non-Google test address as well. – Dom Stubbs Nov 29 '12 at 15:51
  • "Mail sent successfully." – Mike Dexter Nov 29 '12 at 15:54
  • Did you try another email provider as well? If so now's probably the time to contact the host/server admin. – Dom Stubbs Nov 29 '12 at 16:01
  • email provider? as in phpmail or sendmail? – Mike Dexter Nov 29 '12 at 16:10
1

If all of the following are true:

  • emails come through fine when sent to addresses that do not use the same domain as your site
  • emails are never delivered to any user@example.com (where example.com is the site domain name)
  • you are not using your web host's nameservers, but are setting an MX Record for Google Apps with your domain registrar.

...then I'd recommend checking with your web host and letting them know you are not using their nameservers and for them to make sure there isn't anything that would attempt to pick up mail sent by the server to addresses at your domain (when that mail should really be routed to Google Apps).

A bit of a shot in the dark, but I seem to have encountered this issue a couple of times and it was resolved by contacting the web host.

| improve this answer | |
1

Just wanted to say thank you to everyone for their help and advice on this issue.

As some of you suspected, after all the trial and error the issue was hosting related.

According to the hosting provider the Parallels/Linux server hosting the site required a patch to be applied that allowed PHP Mail to communicate with with a mail server that is using IPv6 - which the Google mail servers now are. Which is why emails were going to all the trial email addresses except for this Google Apps/Gmail addresses.

Now that the patch has been applied to the server, "Admin > Email Configuration > Email Protocol > PHP Mail" is working just fine.

| improve this answer | |
0

I used to have this problem fairly consistently until I figured out the issue:

If your email is hosted separately from your primary web hosting, make sure you have the webhost's email service turned OFF for that domain. There are usually tools within their control panel or Plesk to allow you to do this.

It's solved the issue for me in nearly all cases where the email stopped working after moving to the live domain. Hope that helps.

| improve this answer | |
0

I know I'm late to the party but I've got Gmail working with CartThrob. Do you possibly have the wrong settings configured for Gmail/GoogleApps?

This works for me:

$config['mail_protocol']    = 'smtp';
$config['smtp_server']      = 'ssl://smtp.gmail.com:465';    // Use :XXX to set the port number.
$config['smtp_username']    = 'username@gmail.com'; // GA - username@customdomain.com 
$config['smtp_password']    = 'password';
$config['email_newline']    = "\r\n";
$config['email_crlf']       = "\r\n";
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.