Symfony 3.1とSwiftMailerを使用してテスト電子メールを送信したかったのですが、動作しません。私は他のソリューションを読んでいましたが、それでも機能しません。Symfony 3.1 swiftmailerのメールは送信されません
Config.yml:
swiftmailer:
transport: %mailer_transport%
encryption: %mailer_encryption%
auth_mode: %mailer_auth_mode%
host: %mailer_host%
username: %mailer_user%
password: %mailer_password%
spool: { type: memory }
Parameters.yml私がしようとしていた
mailer_transport: smtp
mailer_encryption: ssl
mailer_auth_mode: login
mailer_host: smtp.gmail.com
mailer_user: [email protected]
mailer_password: mypass
Parameters.yml v.2の:
mailer_transport: gmail
mailer_encryption: ssl
mailer_auth_mode: login
mailer_host: smtp.gmail.com
mailer_user: [email protected]
mailer_password: mypass
コントローラー:
public function contactAction(Request $request)
{
$name = $request->request->get('name');
$surname = $request->request->get('surname');
$email = $request->request->get('email');
$subject = $request->request->get('subject');
$message = $request->request->get('message');
$data = "";
if($request->request->get('contact_submit')){
$message = \Swift_Message::newInstance()
->setSubject($subject)
->setFrom($email)
->setTo('[email protected]')
->setBody($message);
$this->get('mailer')->send($message);
$data = "Thank you: $name";
}
return $this->render('przedszkole/contact.html.twig', array('data' => $data));
}
そう後、Submitを私の見解の変更をクリックして、私を見る:あなたの$名をありがとうございました、しかし、私はすべての電子メールを得ることはありません:/
誰かが他のソリューションに言うように、私は自分のGmailのメールのセキュリティLVLを変更しかし、それは私のために助けにはなりません:/
私はまた、config_dev.ymlのdelivery_adressのコメントを解除します。
私は任意の助けのために感謝するでしょう:私はあなたがする必要はありませんデフォルト設定があることを読ん
mailer_transport: gmail
mailer_user: [email protected]
mailer_password: mypass
:どのように(のみ)は以下のYMLの設定を使用する程度/
ここで解説した解決策を試しましたか:http://stackoverflow.com/questions/3478906/using-phps-swiftmailer-with-gmail – LBA
どのバージョンのPHPを使用していますか?サーバーログやSymfonyツールバーに関連するエラーが表示されますか? –
PHP 5.6.23。私はどこにでもエラーが表示されません。 – Abdulos