Troubleshooting email sending
Permalink
I've created a c5 site with a 'Contact Us' form. The form has email notification enabled, but when I use the form, the email isn't sent to my test account. What I was hoping for is an outline of where I should check for the disconnect. My first suspicion is to start with the lowest-level call - I assume a 'sendmail' somewhere in PHP. But, I thought I'd check to see if anyone else had troubleshooting suggestions. Does anyone?
make sure it's not being caught as spam.
Thanks, that was the first thing I checked.
if the domain you're sending to is the same as the website but you have mx records pointing somewhere else, you have to make sure the webserver knows that.
if you find emails to other domains work fine, this is typically the problem.
if you find emails to other domains work fine, this is typically the problem.
I've been trying to send the email to a gmail account, and I haven't tested sending to an address on the same domain yet. Thanks, I'll check that out and report back. I know it's the inverse of the test you pointed out, but still not a bad one.
Appears that emailing within the domain also doesn't work. So no emailing works.
yeah can you contact your webhost or do a basic PHP mail call to see if mail works from your server at all?
I just did two tests, one with PHP from the commandline and one from a web browser. The commandline PHP sent the email, the webserver did not. Here's the contents:
<html>
<head><title>Email Test</title></head>
<body>
<p><?php
print "Testing mail function...";
$success = mail("blurredout@gmail.com","Test from webserver","This is a test from the webserver");
print "Email sent.";
print $success;
?></p>
</body>
</html>
And here's the CLI version:
<?php
echo "Emailing...";
$success = mail("blurredout@gmail.com","Email test from CLI","This is a test from the CLI. I hope you enjoy. -Yourself");
print "You were successful:";
print $success;
print "\n";
?>
I figure my scripts are sane, they are pretty straightforward. Looks like it's time to contact my webhost...good 'ole Dreamhost.
<html>
<head><title>Email Test</title></head>
<body>
<p><?php
print "Testing mail function...";
$success = mail("blurredout@gmail.com","Test from webserver","This is a test from the webserver");
print "Email sent.";
print $success;
?></p>
</body>
</html>
And here's the CLI version:
<?php
echo "Emailing...";
$success = mail("blurredout@gmail.com","Email test from CLI","This is a test from the CLI. I hope you enjoy. -Yourself");
print "You were successful:";
print $success;
print "\n";
?>
I figure my scripts are sane, they are pretty straightforward. Looks like it's time to contact my webhost...good 'ole Dreamhost.
I have a C5 site hosted on a Dreamhost server and have also encountered emails not reaching account holders. But its not a consistant problem, so I think its more likely down to spam filtering rather than the code. Perhaps C5 doesn't add enough information to the mail header to satisfy all anti-spam software?
I just got this reply from dreamhost support, which is informative:
==================
Thank you for contacting us. The issue is that you are using your own php
build. When I comment out the reference to your custom php build in the
htaccess file at the root of the website my test mail script works at
http://blurredout.com/test.php . When I uncomment the references
and your custom php build becomes active the test script fails.
This is the headers of the email sent by the test script that confirms
that emails originated from your server:
Delivered-To: dreamhoster@gmail.com
Received: by 10.140.203.8 with SMTP id a8cs59327rvg;
Wed, 19 Aug 2009 03:25:42 -0700 (PDT)
Received: by 10.115.86.19 with SMTP id o19mr7185460wal.212.1250677541492;
Wed, 19 Aug 2009 03:25:41 -0700 (PDT)
Return-Path: <blurredout@trafficante.dreamhost.com>
Received: from smarty.dreamhost.com (smarty.dreamhost.com
[208.113.175.8])
by mx.google.com with ESMTP id
34si6704734pxi.62.2009.08.19.03.25.41;
Wed, 19 Aug 2009 03:25:41 -0700 (PDT)
Received-SPF: pass (google.com: domain of
blurredout@trafficante.dreamhost.com designates 208.113.175.8 as
permitted sender) client-ip=208.113.175.8;
Authentication-Results: mx.google.com; spf=pass (google.com: domain of
blurredout@trafficante.dreamhost.com designates 208.113.175.8 as
permitted sender) smtp.mail=blurredout@trafficante.dreamhost.com
Received: from trafficante.dreamhost.com (trafficante.dreamhost.com
[67.205.4.73])
by smarty.dreamhost.com (Postfix) with ESMTP id 1FA77EE260
for <dreamhoster@gmail.com>; Wed, 19 Aug 2009 03:25:41 -0700
(PDT)
Received: by trafficante.dreamhost.com (Postfix, from userid 2921776)
id 22ACF824E; Wed, 19 Aug 2009 03:25:41 -0700 (PDT)
To: dreamhoster@gmail.com
Subject: Hi!
Message-Id: <20090819102541.22ACF824E@trafficante.dreamhost.com>
Date: Wed, 19 Aug 2009 03:25:41 -0700 (PDT)
From: blurredout@trafficante.dreamhost.com (blurred out)
Hi,
How are you?
_________________
I can only recommend that if you wish to use phpmail that you will use
the DreamHost provided php build.
Thanks!
Trey K
===================================
So, looks like it's related to my custom PHP, which is to enable me to have pretty URLs with Concrete5. Sigh. But, understandable.
==================
Thank you for contacting us. The issue is that you are using your own php
build. When I comment out the reference to your custom php build in the
htaccess file at the root of the website my test mail script works at
http://blurredout.com/test.php . When I uncomment the references
and your custom php build becomes active the test script fails.
This is the headers of the email sent by the test script that confirms
that emails originated from your server:
Delivered-To: dreamhoster@gmail.com
Received: by 10.140.203.8 with SMTP id a8cs59327rvg;
Wed, 19 Aug 2009 03:25:42 -0700 (PDT)
Received: by 10.115.86.19 with SMTP id o19mr7185460wal.212.1250677541492;
Wed, 19 Aug 2009 03:25:41 -0700 (PDT)
Return-Path: <blurredout@trafficante.dreamhost.com>
Received: from smarty.dreamhost.com (smarty.dreamhost.com
[208.113.175.8])
by mx.google.com with ESMTP id
34si6704734pxi.62.2009.08.19.03.25.41;
Wed, 19 Aug 2009 03:25:41 -0700 (PDT)
Received-SPF: pass (google.com: domain of
blurredout@trafficante.dreamhost.com designates 208.113.175.8 as
permitted sender) client-ip=208.113.175.8;
Authentication-Results: mx.google.com; spf=pass (google.com: domain of
blurredout@trafficante.dreamhost.com designates 208.113.175.8 as
permitted sender) smtp.mail=blurredout@trafficante.dreamhost.com
Received: from trafficante.dreamhost.com (trafficante.dreamhost.com
[67.205.4.73])
by smarty.dreamhost.com (Postfix) with ESMTP id 1FA77EE260
for <dreamhoster@gmail.com>; Wed, 19 Aug 2009 03:25:41 -0700
(PDT)
Received: by trafficante.dreamhost.com (Postfix, from userid 2921776)
id 22ACF824E; Wed, 19 Aug 2009 03:25:41 -0700 (PDT)
To: dreamhoster@gmail.com
Subject: Hi!
Message-Id: <20090819102541.22ACF824E@trafficante.dreamhost.com>
Date: Wed, 19 Aug 2009 03:25:41 -0700 (PDT)
From: blurredout@trafficante.dreamhost.com (blurred out)
Hi,
How are you?
_________________
I can only recommend that if you wish to use phpmail that you will use
the DreamHost provided php build.
Thanks!
Trey K
===================================
So, looks like it's related to my custom PHP, which is to enable me to have pretty URLs with Concrete5. Sigh. But, understandable.