![](/img/trans.png)
[英]Prevent header from email when sending from swift mailer in symfony
[英]Symfony 4 + Swift Mailer - error when sending email from 127.0.0.1
Symfony 4 應用程序使用 Swift Mailer 發送電子郵件。
我已經編寫了我的控制器邏輯並創建了一個表單,電子郵件都在生產服務器上工作。
但是在從php bin/console server:run
開發模式下php bin/console server:run
我得到錯誤:
Service "logger" not found: even though it exists in the app's container, the container inside "App\Controller\PageController" is a smaller service locator that only knows about the "form.factory", "http_kernel", "parameter_bag", "request_stack", "router", "security.authorization_checker", "security.csrf.token_manager", "security.token_storage", "serializer", "session" and "twig" services.
Try using dependency injection instead.
我只是按原樣使用捆綁包。 為什么我不能從本地開發環境發送電子郵件?
您以某種方式替換了App\\Controller\\PageController
Symfony 的默認容器。 此消息基本上意味着對象未在容器中設置其依賴項。 詳情請看這里: https : //symfony.com/doc/current/service_container.html
Symfony 使用容器模式,它將許多對象保存在一個容器中,可以通過整個應用程序訪問。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.