我在symfony 3上遇到swiftmailer問題我花了3天搜索問題沒有任何結果 我想爲我的web應用程序發送確認郵件,發送郵件的功能正常運行但與statut 302請求retun和日誌錯誤:出現 異常而沖洗電子郵件隊列:預期響應代碼220,但得到的代碼「」,與消息「」這樣的郵件不會diliveredsymfony 3 swiftmalier不發送郵件
,這裏是我的confugration文件
config.yml
swiftmailer:
transport: '%mailer_transport%'
host: '%mailer_host%'
encryption: ssl
port: 465
username: '%mailer_user%'
password: '%mailer_password%'
spool: {type: memory}
parameters.yml
parameters:
mailer_transport: smtp
mailer_host: smtp.mail.yahoo.com
mailer_user: [email protected]
mailer_password: test
secret: ThisTokenIsNotSoSecretChangeIt
和maillin行動
public function mailingAction()
{
$message = \Swift_Message::newInstance()
->setSubject('Hello Email')
->setFrom('[email protected]')
->setTo('[email protected]')
->setBody("test mail");
//$mailer = $this->get('mailer')->send($message);
$this->get('mailer')->send($message);
,並感謝
在註釋send()時動作是否工作?使用假脫機程序時,如果請求中稍後出現其他錯誤,它將不會發送電子郵件,請參閱:https://symfony.com/doc/current/email/spool.html#spool-using-memory「這意味着如果整個請求被執行而沒有任何未處理的異常或任何錯誤,電子郵件只會被髮送。「 – dbrumann