mailer = $mailer; $this->params = $params; } protected function configure() { $this ->setName('zitec:mailer:test') ->addArgument( 'emailaddress', InputArgument::REQUIRED, 'Email destination address. The origin address is configured as env parameter customer.care.email.sender' ) ->setDescription('Send mail to specified address') ; } protected function execute(InputInterface $input, OutputInterface $output) { $to=$input->getArgument('emailaddress'); $from=$this->params->get('customer.care.email.sender'); $body = '

Test Mail send to '.$to.' from '.$from.'

'; $message = new \Swift_Message('TestMail'); $message->setSubject('Mailer Test') ->setFrom($from) ->setTo($to) ->setBody($body, 'text/html'); $this->mailer->send($message); } }