Symfony2 Symblog tutorial swift mail not getting email icon in developer bar
-
30-10-2019 - |
Вопрос
i am following this tutorial:
http://tutorial.symblog.co.uk/docs/validators-and-forms.html
at the swift mailer part i am not getting the envelope icon in the developer bar. i am following the tutorial on my dev box so it wont send the actual email therefore i must get the envelope?
here my app/config/parameters.ini:
mailer_transport = "gmail"
mailer_encryption = "ssl"
mailer_auth_mode = "login"
mailer_host = "smtp.gmail.com"
mailer_user = "myemail@host.net"
mailer_password = "mypassword"
then i have src/Blogger/BlogBundle/Controller/PageController.php:
public function contactAction()
{
#return $this->render('BloggerBlogBundle:Page:contact.html.twig');
$enquiry = new Enquiry();
$form = $this->createForm(new EnquiryType(), $enquiry);
$request = $this->getRequest();
if ($request->getMethod() == 'POST')
{
$form->bindRequest($request);
if ($form->isValid())
{
// Perform some action, such as sending an email
$message = \Swift_Message::newInstance()
->setSubject('Contact enquiry from symblog')
->setFrom('enquiries@symblog.co.uk')
->setTo($this->container->getParameter('blogger_blog.emails.contact_email'))
->setBody($this->renderView('BloggerBlogBundle:Page:contactEmail.txt.twig', array('enquiry' => $enquiry)));
$this->get('mailer')->send($message);
$this->get('session')->setFlash('blogger-notice', 'Your contact enquiry was successfully sent. Thank you!');
// Redirect - This is important to prevent users re-posting
// the form if they refresh the page
return $this->redirect($this->generateUrl('BloggerBlogBundle_contact'));
}
}
return $this->render('BloggerBlogBundle:Page:contact.html.twig', array(
'form' => $form->createView()
));
after this i have everything like they have it,what am i missing? please help? thanks
Нет правильного решения
Не связан с StackOverflow