我正在使用 Symfony 5.3 創建從控制臺發送電子郵件的命令,但電子郵件未發送且沒有錯誤。在我的網站上,我有發送電子郵件的頁面,一切正常。這是我的命令執行功能:
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
$email = (new Email())
->from('*****')
->to('*****')
->subject('test')
->html('test');
$this->mailer->send($email);
$io->success('Export terminé');
return 0;
}
uj5u.com熱心網友回復:
我找到了解決方案:我正在使用
Symfony\Component\Mailer\MailerInterface
郵件程式的類,它與
Symfony\Component\Mailer\Transport\TransportInterface
班級
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/487991.html
