syntax: expecting T_catch

I’m updating a years old mailer code to PHP5. Still learning. Any help appreciated. Thanks usit

ERROR using class.phpmailer.php: “ unexpected T_STRING, expecting T_CATCH in /home/xxx/web/tstJan2013/class.phpmailer.php on line 594 “ snippet follows

[php] public function Send() {
try {
if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) {
throw new phpmailerException($this->Lang(‘provide_address’), self::STOP_CRITICAL);
}

  // Set whether the message is multipart/alternative
  if(!empty($this->AltBody)) {
    $this->ContentType = 'multipart/alternative';
  }

  $this->error_count = 0; // reset errors
  $this->SetMessageType();
  $header = $this->CreateHeader();
  $body = $this->CreateBody();

  if (empty($this->Body)) {
    throw new phpmailerException($this->Lang('empty_message'), self::STOP_CRITICAL);
  }

  // digitally sign with DKIM if enabled
  if ($this->DKIM_domain && $this->DKIM_private) {
    $header_dkim = $this->DKIM_Add($header,$this->Subject,$body);
    $header = str_replace("\r\n","\n",$header_dkim) . $header;
  }

  // Choose the mailer and send through it
  switch($this->Mailer) {
    case 'sendmail':
      return $this->SendmailSend($header, $body);
    case 'smtp':
      return $this->SmtpSend($header, $body);
    default:
      return $this->MailSend($header, $body);
  }

} mycatch (phpmailerException $e) {	#line 594
  $this->SetError($e->getMessage());
  if ($this->exceptions) {
    throw $e;
  }
  echo $e->getMessage()."\n";
  return false;
}

}
[/php]

‘mycatch’ should be ‘catch’

Thank you m@tt.
All 6 instances corrected.
That was just to check that phpmailer.php was installed and viable.
Now to the rest of the job.

I do appreciate your help – what an effective service!
usit

Sponsor our Newsletter | Privacy Policy | Terms of Service