通过电子邮件获得此响应"HTTP/1.0 200 OK缓存控制:无缓存内容类型:text/html; charset = UTF-8日期:星期二,2012年11月13日04:56:14 GMT".
这是我的代码:
public function sendEmail($subject, $template, $templateParams)
{
$userEmail = $this->session->get('email');
$name = $this->session->get('name');
$adminEmail = $this->container;
$templateParams['username'] = $name;
$message = \Swift_Message::newInstance()
->setSubject($subject)
->setFrom($adminEmail)
->setTo($userEmail)
->setBody($this->templating->render('SocialDonSocialBundle:Email:'.$template,$templateParams), 'text/html');
$this->mailer->send($message);
Run Code Online (Sandbox Code Playgroud)
另请注意,此方法属于服务即"电子邮件".我创建了一个服务"电子邮件",负责发送电子邮件.有谁知道可能是什么问题?