|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
On our LAMP server, 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.
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@fidello.net"); $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. 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 |
|
#2
|
||||
|
||||
|
If the application injecting the email doesn't include a date field, then the MTA (e.g. sendmail, qmail) will add one in.
However, whether you use PHP to add a date field or leave this to your MTA, both these will produce an incorrect date field if your system clock is wrong. What does the output of the date command say? There is also the slim possibility that you have a broken MTA which doesn't add a date field when required. If you provide the source of one of the email messages, then we can verify this. See http://216.239.37.104/search?q=cach...&hl=en&ie=UTF-8 for further discussion.
__________________
Alex (http://www.alex-greg.com) |
|
#3
|
|||
|
|||
|
Quote:
Here's the "visible" information: Subject: Status Update From: "My Website" <me@mysite.com> Date: Wed, December 31, 1969 7:00 pm To: URL Priority: Normal "Full" header info: Return-Path: <me@mysite.com> Delivered-To: URL Received: (qmail 2720 invoked from network); 17 Oct 2003 17:17:35 -0000 Received: from unknown (HELO URL) (me@192.168.1.26) by 0 with SMTP; 17 Oct 2003 17:17:35 -0000 MIME-Version: 1.0 From: "My Website" <me@mysite.com> Subject: Status Update X-Mailer: HTML Mime mail Content-Type: text/html; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable Message-ID: <hmwwir.b6t@URL> To: URL So, where is that 1969 date coming from?? Thanks. |
|
#4
|
||||
|
||||
|
Quote:
"Visible" where? The incorrect date field (and the priority) is "visible" in whatever you're using to view the mail, but not in the "full" header information. You also didn't answer my previous question: What does the output of the date command (run on your server) say? |
![]() |
| Viewing: Dev Shed Forums > System Administration > Mail Server Help > All sent mail says "Wed, December 31, 1969 7:00 pm" |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|