Posted on 2006-04-19
I am writing and testing code for a web site but I am doing all of the testing on my local computer. I am running a sample to test the funtionality of PHPMailer. When I run the sample on an actual hosted website everything goes well and the e-mail gets sent. However, when I run the sample from my local computer I get a number of warning messages but the e-mail still goes through.
There are about 40 messages regarding class.phpmailer.php and about 6 messages regarding class.smtp.php.
The messages are all the same except the line number.
The messages say:
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in c:\program files\e-novative\WAMP\www\phpmail\sample01\class.phpmailer.php on line 30
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in c:\program files\e-novative\WAMP\www\phpmail\sample01\class.phpmailer.php on line 36
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in c:\program files\e-novative\WAMP\www\phpmail\sample01\class.smtp.php on line 49
The e-mail does go through but I get all of these messages.
I need to demo my program without putting the files on a hosted site.
Can anyone offer a suggestion as to how to eliminate these messages?
Below is my sample code:
$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to use SMTP
$mail->Helo = "mail.tescor-inc.com";
$mail->Host = "mail.tescor-inc.com"; // smtp server
$mail->From = "email@example.com";
$mail->FromName = "cbeaver";
$mail->WordWrap = 50; // set word wrap to 50 characters
$mail->IsHTML(true); // set email format to HTML
$mail->Subject = "Sample E-mail";
$mail->Body = "<p>Body in HTML!!</p>";
$mail->AltBody = "Body in Plain Text!";
error ("Message could not be sent".$mail->ErrorInfo);
else echo "Mail sent!";