Re: Variable Scope problem passing function parameters

From: Date: Thu, 18 Dec 2008 19:20:36 +0000
Subject: Re: Variable Scope problem passing function parameters
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-284806@lists.php.net to get a copy of this message
metastable wrote:
Jim McIntyre wrote:
    $phpMail = new PHPMailer();
    $phpMail->From = $from;
    $phpMail->AddAddress($this->to);
    $phpMail->Subject = $subject;
    $phpMail->Body = $body;
    return $phpMail->Send();
$this -> to it has no meaning in the scope of your class.
Apparently, neither do the other variable names. If I replace that with a string containing my email address, it sends an email... but everything else in the email is blank - no body, no subject, etc. How do I reference the arguments passed to the function when setting properties or calling methods of the instance of PHPMailer?

« previous php.general (#284806) next »