我是 Symfony 的初学者,我必须在我的网络服务中放置一个 Mailer。但我有一个我不明白的 php 异常。
\n有我的邮件功能:
\n private function sendMail(MailerInterface $mailer, $p_leTI, $mail)\n {\n $pole = $p_leTI['pole'];\n $type = $pole === 1 ? 'Logiciel' : ($pole === 2 ? 'Mat\xc3\xa9riel' : 'Incident');\n $client = $p_leTI['nomCli'];\n $email = (new Email())\n ->from(new Address('random@gmail.com', 'Support Id\xc3\xa9ation Informatique'))\n ->to(new Address('random@gmail.com'))\n ->bcc(new Address('random@gmail.com'))\n ->subject("Ticket $type Site: $client")\n ->text("Client: $client\\r\\nObservation: {$p_leTI['OBSERVATION']}")\n ->html("<html lang='fr'>\n <body>\n <p>Demandeur: {$p_leTI['nomCli']}</p>\n <p>Description: {$p_leTI['OBSERVATION']}</p>\n <p>T\xc3\xa9l\xc3\xa9phone: {$p_leTI['TEL']}</p>\n <p>Email: {$p_leTI['EMAILCLIENT']}</p>\n </body>\n </html>");\n $mailer->send($email);\n\n $email = (new TemplatedEmail())\n ->from(new Address('random@gmail.com', 'Support Id\xc3\xa9ation Informatique'))\n …
Run Code Online (Sandbox Code Playgroud)