Link to home
Create AccountLog in
Avatar of charlieb01
charlieb01

asked on

PHPMailer Question

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?

Thanks,
Charlie


Below is my sample code:

<?
$email="charliebeaver@verizon.net";

require("class.phpmailer.php");
$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 = "cbeaver@tescor-inc.com";
$mail->FromName = "cbeaver";
$mail->AddAddress($email);

$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!";

if(!$mail->Send())
{
   error ("Message could not be sent".$mail->ErrorInfo);
      exit;
}
  else echo "Mail sent!";
?>

ASKER CERTIFIED SOLUTION
Avatar of Roonaan
Roonaan
Flag of Netherlands image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.