function MailerTestCommand::execute
Overrides Command::execute
File
-
vendor/
symfony/ mailer/ Command/ MailerTestCommand.php, line 57
Class
- MailerTestCommand
- A console command to test Mailer transports.
Namespace
Symfony\Component\Mailer\CommandCode
protected function execute(InputInterface $input, OutputInterface $output) : int {
$message = (new Email())->to($input->getArgument('to'))
->from($input->getOption('from'))
->subject($input->getOption('subject'))
->text($input->getOption('body'));
if ($transport = $input->getOption('transport')) {
$message->getHeaders()
->addTextHeader('X-Transport', $transport);
}
$this->transport
->send($message);
return 0;
}