My PHP mail is sending with the wrong date and time. I set the PHP time:
date_default_timezone_set('Europe/Brussels');
and when I
echo date('r');
I get the right time. However, when I send mail, the mail date is time + 1 day + 1 hour.
I searched around and found some old documents where it was a PHP error or so, but they date from 2001 and 2005, so I assume that I am doing something else wrong ... I expect that the error in sending is not there will be mail since it is being sent, but I will still send my code:
<?php session_start(); date_default_timezone_set('Europe/Brussels'); $receiver = ' test@yourhost.com '; $subject = 'Test'; $message = 'This is a test'; $receiver = $email; $headers = "From: me@myhost.com " . "\r\n" . "X-Mailer: PHP/" . phpversion(); if(mail($receiver,$subject,$message,$headers)){
source share