diff options
Diffstat (limited to 'src/AppBundle/Controller/EmailController.php')
-rw-r--r-- | src/AppBundle/Controller/EmailController.php | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/src/AppBundle/Controller/EmailController.php b/src/AppBundle/Controller/EmailController.php deleted file mode 100644 index 982234e..0000000 --- a/src/AppBundle/Controller/EmailController.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php -/** - * Created by PhpStorm. - * User: marcin - * Date: 11/23/17 - * Time: 10:21 AM - */ - -namespace AppBundle\Controller; - -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; -use Symfony\Bundle\FrameworkBundle\Controller\Controller; -use Swift_SmtpTransport; -use Swift_Mailer; -use Swift_Message; - -class EmailController extends Controller -{ - /** - * @Route("/email") - */ - public function sendEmail() - { -// Create the Transport - $transport = (new Swift_SmtpTransport('mail.cock.li', 465, 'ssl')) - ->setUsername('***REMOVED***') - ->setPassword('***REMOVED***') - ; - -// Create the Mailer using your created Transport - $mailer = new Swift_Mailer($transport); - -// Create a message - $message = (new Swift_Message('Pollutometer warning ' . date('d/m/Y h:i:s'))) - ->setFrom(['***REMOVED***' => 'Pollutometer']) - ->setTo(['***REMOVED***@edu.easj.dk' => 'A name']) - ->setBody($this->renderView( - // templates/emails/warning.html.twig - 'warning.html.twig', - array('name' => 'Test') - ), - 'text/html') - ; - -// Send the message - $result = $mailer->send($message); - - return $this->render('warning.html.twig', array('name' => 'Test')); - } - -} |