Having some problems implementing swiftmailer with new symfony2 beta4, below is my code
$mailer = $this->container->get('mailer');
$name = ucwords(str_replace('.',' ', $user->getScreenName()));
$email = 'me@me.com';
$message = $mailer::newInstance()
->setSubject('New Password')
->setFrom('Neokeo <blah@blah.com>')
->setTo("$name <$email>")
->setBody($this->renderView('MyBundle:User:reset.html.php', array('user',$user)));
$mailer->send($message);
and mistake
Catchable fatal error: Argument 1 passed to Swift_Mailer::newInstance() must implement interface Swift_Transport, none given
Does anyone know what I can do to fix this?
source
share