• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 977
  • Last Modified:

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

0
charlieb01
Asked:
charlieb01
2 Solutions
 
RoonaanCommented:
Hi,

I guess this is because your local server is running php 5 and your remote server could be running php 4.

-r-
0
 
ixtiCommented:
Roonaan is totally right! This is because your local server is running php 5 and your remote server could be running php 4.
You can hide them by creating (if not exist) and adding a line in .htaccess in root of your site:
php_value error_reporting 'E_ALL & ~E_NOTICE'
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now