0
在config.yml的Symfony2在我的控制器发送电子邮件不工作
# Swiftmailer Configuration
swiftmailer:
transport: sendmail
username: %mailer_user%
password: %mailer_password%
disable_delivery: false
:
$from = $data['email'];
//$sento = self::getSiteInfo()->getEmail();
$sento = '[email protected]';
$message = \Swift_Message::newInstance()
->setSubject('Nouveau message')
->setFrom($from)
->setTo($sento)
->setBody(
$this->renderView(
'RootSiteBundle:Front:email.txt.twig',
array('data' =>$data)
)
);
$this->get('mailer')->send($message);
请你可以添加更多关于错误消息的详细信息/是将它发送到邮件队列的电子邮件吗? – BillyBigPotatoes
有没有错误信息!,但电子邮件没有发送 – jsf
你也使用什么版本的'swiftmailer'? 'v.2.3.2'中有'sendmail'的错误。看到这个[问题的细节](http://stackoverflow.com/questions/19911648/symfony2-swiftmailer-sendmail-transport-error)。 – ferdynator