Phpmailer error

hey folks,
i m trying to run a email script but i get this error


[B]Notice[/B]:  Undefined variable: Encoding in [B]C:\\xampp\\htdocs\\sandbox\\phpmailer.inc.php[/B] on line [B]271[/B]

[B]Fatal error[/B]:  Cannot access empty property in [B]C:\\xampp\\htdocs\\sandbox\\phpmailer.inc.php[/B] on line [B]271[/B]

and at like 271 of phpmailer is

 $header[] = sprintf("Content-Transfer-Encoding: %s\
", $this->$Encoding);

what is missing?

It might help to show more code.

here


<?php
$mail = new phpmailer();

$mail->IsSMTP();
$mail->Host ="smtp.gmail.com";
$mail->Port = 465;
$mail->SMTPAuth = true;
$mail->Username = "abc@gmail.com";
$mail->Password = "xxx";
//var declared
$from_name = "Nof";
$from = "....@gmail.com";
$to = "...@gmail.com";
$to_name = "Dani";
$message = "Hi, This is just a test email";
$subject = "test Email from N";


$mail->FromName = $from_name;
$mail->From = $from;
$mail->AddAddress($to,$to_name);
$mail->Subject = $subject;
$mail->Body = $message;

$result = $mail->Send();
echo $result ? 'Sent' : 'Error';
?>

i found help on another form saying to remove $ from infront of $Encoding from phpmailer.inc which i did and error was gone but now i get the ‘Error’ msg from echo $result ? ‘Sent’ : ‘Error’;

You don’t need a $ after the -> that is correct and i missed that when i made my last post.

You’ve done the correct thing to remove it.

What is $result supposed to be? - a boolean?

I’m not great with ternarys in php but your doesn’t look right to me. Take a look at this and scroll down to the ternary section.