I have the following code which works when i put it in any blank php page,but when i try to put the code in another php page where i already have some codes in it, i get the error:
ERRNO: 8192 TEXT: Assigning the return value of new by reference is deprecated LOCATION: C:\xampp\php\PEAR\Mail.php, line 154,
include('Mail.php');
$mail = Mail::factory("mail");
$headers = array("From"=>"xyz@gmail.com", "Subject"=>"Your order has been placed ");
$body = "lol";
$mail->send("abc@live.com", $headers, $body);
You probably have an old version of PEAR::Mail. Could be version 1.1.14, the last stable version before the current stable version 1.2.0.
Try
to get the latest version.
edit: This is not actually part of the answer but doesn’t fit in a comment either:
For debugging purposes replace the factory function in pear/Mail.php by