title: PHP Error: Fatal error: Call to undefined method
body: <p>I'm having a problem with my Mail class. It was working before, but now i'm not sure what happened. here is the error:</p>
  
  <pre><code>Fatal error: Call to undefined method Mail::sendTo() in C:\...\web\modules\register.php on line 30
  </code></pre>
  
  <p>My mail class:</p>
  
  <pre><code>class Mail
  {
  public static $Headers = 'From:akshay@myemail.com';
  public $sendtowho;
  public $subject;
  public $message;
  public $template;
  
  public function sendTo($who='')
  {
      $this-&gt;sendtowho = $who;
  }
  
  public function with($subj='',$template)
  {
      $this-&gt;subject = $subj;
      $this-&gt;template = $template;
  }
  
  public function addVars($variables)
  {
      $TemplateHandler = new Template('mail');
      $this-&gt;message = $TemplateHandler-&gt;renderContent($this-&gt;template, $variables);
  }
  
  public function send()
  {
      mail($this-&gt;sendtowho, $this-&gt;subject, $this-&gt;message, self::$Headers);
  }
  }
  </code></pre>
  
  <p>My register.php</p>
  
  <pre><code>$mail = new Mail();
  $mail-&gt;sendTo(User::getMailFromUsername($username));
  $mail-&gt;with(' Registration Info','registration');
  $mail-&gt;addVars(array('name' =&gt; User::getNameFromUsername($username), 'regKey' =&gt; $regKey));
  $mail-&gt;send();
  </code></pre>
  
  <p>Line where the error is happening:</p>
  
  <p><code>$mail-&gt;sendTo(User::getMailFromUsername($username));</code></p>
  
  <p>I'd appreciate any help, thanks!</p>
  
  <p>EDIT: Made some change to names of method and var to, so you can understand it better. BUT STILL GIVING SAME ERROR!!</p>