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;
}
}
$from = 'мыло@мыло';
$subject = 'Регистрация в электронной библиотеке ';
$message = "Ваш логин: $email Ваш пароль: $genpass";
$useful->sendmail($email, $from, $subject, $message);
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;
}
http://phpfaq.ru/debug#showотладка, понимание причин ошибок и их исправление - это и есть работа программиста. Не понимаешь - берешь и разбираешься.