Jump to content

Mail, headers, date problem


nakkiel

Recommended Posts

Hi,

 

I am trying to create an emailer page, and I cannot seem to get the date right. I searched this forum but the only topic that was a bit useful did not really solve the problem. In any case, here's my code:

 

<html>
<body>
<?php

$to = "[email protected]"; // Change this to your e-mail address 
$subject = "PHP mail message";
$message = "This mail was sent using PHP mail funtion.";

$headers = 'From: Woo Hoo <[email protected]>' . "\r\n";
$headers .= 'Date: ' . date ( 'r' ) . "\r\n";

if (mail ($to, $subject, $message, $headers)) {
echo "Success.<br />\n";
}
else {
echo "Failure.<br />\n";
}

?>
</body>
</html>

 

I have tried various date function styles as well as changing the whole $headers line. Every time I just get the current time as date or 1.1.1970 for date.

 

Thx in advance.

Link to comment
https://forums.phpfreaks.com/topic/99135-mail-headers-date-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.