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