Решил одну ошибку, появилась другая. Т.к. не имею опыта в программировании, то не понимаю как решить эту проблему: Non-static method Kohana_Email::send() should not be called statically, assuming $this from incompatible context.
Метод отправки имейла в моделе, отвечающей за отправку имейла:
PHP:
public function sendmail($to, $from, $subject, $message)
{
try
{
$count = Email::send($to, $from, $subject, $message, $html = false);
return TRUE;
}
catch (Exception $e)
{
echo $e->getMessage();
return FALSE;
}
}
Я так понимаю ошибка находится здесь (подчеркнуто) $count
= Email::send($to, $from, $subject, $message, $html = false);
Этот метод используется в моделе регистрации, в методе регистрации:
PHP:
$from = 'мыло@мыло';
$subject = 'Регистрация в электронной библиотеке ';
$message = "Ваш логин: $email Ваш пароль: $genpass";
$useful->sendmail($email, $from, $subject, $message);
В ядре мейлера (Kohana_Email) метод описан так:
PHP:
public function send()
{
// Determine the message type
$html = ($this->_html) ? 'text/html' : 'text/plain';
$message = Swift_Message::newInstance($this->_subject, $this->_message, $html, 'utf-8')
->setFrom($this->_from);
foreach (array('to', 'cc', 'bcc') as $param)
{
if (sizeof($this->{'_'.$param}) > 0)
{
$method = 'set'.UTF8::ucfirst($param);
$message->$method($this->{'_'.$param});
}
}
if ( ! empty($this->_reply_to))
{
$message->setReplyTo($this->_reply_to);
}
// Send message
$this->_connection->send($message);
return $this;
}