How to use phpmailer?

i'm using class.mailer.php from http://sourceforge.net/projects/phpmailer/.  When I submit my contact form, I get the following error:

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PDT/-7.0/DST' instead in /Users/brett/Sites/mysite/class.phpmailer.php on line 1925

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for 'PDT/-7.0/DST' instead in /Users/brett/Sites/mysite/class.phpmailer.php on line 1929

Other than that, it works fine.  I've indicated the error lines below.  Any ideas how I can fix it?

public static function RFCDate() { //line 1924
    $tz = date('Z');
    $tzs = ($tz < 0) ? '-' : '+';
    $tz = abs($tz);
    $tz = (int)($tz/3600)*100 + ($tz%3600)/60;
    $result = sprintf("%s %s%04d", date('D, j M Y H:i:s'), $tzs, $tz); //line 1929

    return $result;
  }

Open in new window

brettrAsked:
Who is Participating?
 
HackneyCabConnect With a Mentor Commented:
Is there a reason why you can't use date_default_timezone_set() as the error message suggests. See the manual page:

http://php.net/manual/en/function.date-default-timezone-set.php
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.