0
에 이메일 아이콘을받지 :Symfony2 Symblog 튜토리얼 신속 메일 내가이 튜토리얼 다음하고 개발자 줄
http://tutorial.symblog.co.uk/docs/validators-and-forms.html
을 내가 개발자 줄의 봉투 아이콘을받지하고 신속한 메일러 부분. 내 dev에 상자에 대한 튜토리얼을 따르고 그래서 실제 전자 메일을 보내지 않을거야 그래서 봉투를해야합니까?
여기내 응용 프로그램/설정/parameters.ini :
다음 내가이mailer_transport = "gmail"
mailer_encryption = "ssl"
mailer_auth_mode = "login"
mailer_host = "smtp.gmail.com"
mailer_user = "[email protected]"
mailer_password = "mypassword"
SRC/블로거/BlogBundle/컨트롤러/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('[email protected]')
->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()
));
나는 그들이 같은 모든 것을 가지고 그것을 가지고, 내가 무엇을 놓치고 있습니까? 도와주세요. 감사합니다.
요청 POST 매개 변수 아래의 내용을 보여 주셔서 감사합니다. 또한 입력란의 값을 요청하십시오. 메일에 대한 정보는 어디에서 발송하나요? –
고마워! :) –