Unable to send e-mail from within custom Symfony2 command but can from elsewhere in app

前端 未结 3 615
被撕碎了的回忆
被撕碎了的回忆 2020-12-30 10:45

I have written a custom console command to query my database, produce a report and e-mail it to an address; however I can not seem to successfully send the e-mail. I can sen

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-30 11:35

    Instead of memory spool use file spool. Modify your app/config/config.yml:

    swiftmailer:
        transport: "%mailer_transport%"
        host:      "%mailer_host%"
        username:  "%mailer_user%"
        password:  "%mailer_password%"
        spool:     { type: file, path: %kernel.root_dir%/spool }
    

提交回复
热议问题