小编HAr*_*ron的帖子

symfony Mailer:不发送邮件并且没有错误

我使用 Symfony6.2 Mailer 发送这样的电子邮件 文档

https://symfony.com/doc/current/mailer.html 但邮件未发送(我在收件箱中看不到任何新邮件)并且我没有任何错误?!我的邮件程序.yaml

\`\`\`framework:
    mailer:
        transports:
            main: '%env(MAILER_DSN)%'
Run Code Online (Sandbox Code Playgroud)

我尝试使用调试php bin/console mailer:test,当我使用此命令但当我使用路由功能时,邮件发送成功

    {
        $email = (new Email())
            ->from('hello@example.com')
            ->to('you@example.com')
            //->cc('cc@example.com')
            //->bcc('bcc@example.com')
            //->replyTo('fabien@example.com')
            //->priority(Email::PRIORITY_HIGH)
            ->subject('Time for Symfony Mailer!')
            ->text('Sending emails is fun again!')
            ->html('<p>See Twig integration for better HTML integration!</p>');

        $mailer->send($email);

        // ...
    }
}
Run Code Online (Sandbox Code Playgroud)

我没有收到任何邮件,我希望使用路由在收件箱中找到新邮件

php symfony symfony-mailer symfony6

1
推荐指数
1
解决办法
700
查看次数

标签 统计

php ×1

symfony ×1

symfony-mailer ×1

symfony6 ×1