小编dos*_*sad的帖子

通过 aws ses 从 symfony 邮件程序发送电子邮件时出错

我的适合发送电子邮件的控制器如下所示:

class MailerController extends AbstractController
{
    /**
     * @Route("/email")
     */
    public function sendEmail(MailerInterface $mailer): Response
    {
        $email = (new Email())
            ->from('hello@example.com')
            ->to('you@example.com')
            ->subject('Time for Symfony Mailer!')
            ->text('Sending emails is fun again!')

        $mailer->send($email);

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

访问后/email我收到以下错误:

Failed to authenticate on SMTP server with username "XXX" using the following authenticators: "LOGIN", "PLAIN". Authenticator "LOGIN" returned "Symfony\Component\Mailer\Exception\TransportException: Expected response code "235" but got code "535", with message "535 Authentication Credentials Invalid"
Run Code Online (Sandbox Code Playgroud)

我的邮件程序配置如下所示:

Failed to authenticate on SMTP server with …
Run Code Online (Sandbox Code Playgroud)

php amazon-web-services symfony amazon-ses symfony-mailer

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