Whenever our php application sends emails out, the date on the emails is Wed, December 31, 1969 7:00 pm, which I figure to be UNIX time for ZERO, adjusted (?) for time zone? Maybe.
I'm not sure where to start to find the answer to this one. It appears to be a problem that has always existed (not something that just broke). The server is in Utah, which is Mountain time. I assume this is the equivalent of the time of zero Unix time. To be more specific, the email shows up in my inbox (I'm copied in on each mailing) with the actual receipt time listed, but upon opening the email, the header says Date: Wed, December 31, 1969 7:00 pm. When I select "view full header" in my email (Squirrel webmail) it gives this info:
Return-Path: <Scott.Williams@mycompany.com>
Delivered-To: scott.williams@mycompany.com
Received: (qmail 32222 invoked from network); 24 Oct 2003 18:56:20 -0000
Received: from unknown (HELO www.mycompany.com) (user@192.168.1.26)
by 0 with SMTP; 24 Oct 2003 18:56:20 -0000
MIME-Version: 1.0
From: "My Server" <Scott.Williams@mycompany.com>
Subject: Status Update
X-Mailer: HTML Mime mail
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Message-ID: <hna02o.htp@www.mycompany.com>
To: end.user@othercompany.com
Opening the email shows this:
Subject: Status Update
From: "My Server" <Scott.Williams@mycompany.com>
Date: Wed, December 31, 1969 7:00 pm
To: you@yoursite.net
Priority: Normal
For some recipients this is a major problem, because the mail automatically gets sorted to the very bottom of their inbox, never to see the light of day again.
I doubt this has anything to do with the problem, but here's the code that sends the email out (simplified):
<?php
include_once("newsite.php");
include_once("newdatabase.php");
include_once("htmlMimeMail.php");
function email($resp) {
$subject = "Status Update";
// create email object
$mail = new htmlMimeMail();
);
// Add the text, html and embedded images.
$html_data = fetch_page("email_contents", $assigns);
$mail->setHtml($html_data);
// Set some headers
$mail->setFrom('"My Website" <me@mysite.com>');
$mail->setSubject($subject);
$mail->setHeader('X-Mailer', 'HTML Mime mail');
// Send it using SMTP.
$mail->setBcc("scott.williams@mycompany.com");
$result = $mail->send(array($resp->resp_email), "smtp");
if (!$result) {
echo "<li><font color=red>Error: $mail->errors</font></li>";
}
return $result;
}
if ($sendit) {
error_reporting(E_ALL || ~E_NOTICE);
$recs = $db->get_results("SELECT * FROM user WHERE email_sent IS NULL");
foreach($recs as $rec) {
echo "<li>email sent to $rec->user_name";
if (email($rec)) {
$db->query("UPDATE user SET email_sent=now() WHERE user_name=$rec->user_name");
}
$row++;
}
echo "<li>$row emails sent";
}
?>
Any ideas, pointers on where to look at the documentation, anything, I'd really appreciate it. It uses the HTML MIME Mail at PHPGuru.org. I'm beginning to suspect the "SMTP" side of the send code. I don't really administer this server, but I'm as likely a candidate as any to fix this particular problem. Thanks a lot.
Regards,
Scott Williams
Penfield NY
Oh, yeah, the server is running Windows 2000 Server.