diff --git a/src/Command/MailTestCommand.php b/src/Command/MailTestCommand.php new file mode 100644 index 0000000..63bd2e4 --- /dev/null +++ b/src/Command/MailTestCommand.php @@ -0,0 +1,43 @@ +addArgument('to', InputArgument::REQUIRED, 'Recipient email') + ->addArgument('from', InputArgument::OPTIONAL, 'Sender email', 'team@ep-reisen.de') + ; + } + + protected function execute(InputInterface $input, OutputInterface $output): int + { + $email = (new Email()) + ->to($input->getArgument('to')) + ->from($input->getArgument('from')) + ->subject('Testing SMTP Transport') + ->text('Testing SMTP Transport'); + + $this->mailer->send($email); + + return Command::SUCCESS; + } +}