#include <stdlib.h>
#include <ctype.h>
#include <stdio.h>
+#include <time.h>
#include "php.h"
#include "ext/standard/info.h"
#include "ext/standard/php_string.h"
#include "ext/standard/basic_functions.h"
+#include "ext/date/php_date.h"
#if HAVE_SYSEXITS_H
#include <sysexits.h>
return val; \
if (mail_log && *mail_log) {
- char *tmp;
- int l = spprintf(&tmp, 0, "mail() on [%s:%d]: To: %s -- Headers: %s\n", zend_get_executed_filename(TSRMLS_C), zend_get_executed_lineno(TSRMLS_C), to, hdr ? hdr : "");
+ char *tmp, *date_str;
+ time_t curtime;
+
+ time(&curtime);
+ date_str = php_format_date("d-M-Y H:i:s e", 13, curtime, 1 TSRMLS_CC);
+
+ int l = spprintf(&tmp, 0, "[%s] mail() on [%s:%d]: To: %s -- Headers: %s\n", date_str, zend_get_executed_filename(TSRMLS_C), zend_get_executed_lineno(TSRMLS_C), to, hdr ? hdr : "");
+
+ efree(date_str);
if (hdr) {
php_mail_log_crlf_to_spaces(tmp);