I have followed the steps you gave and it worked, I was quiet amazed by the setup of Mercury, not something you start without knowing what you do. But now I have manage to send emails from Mercury to my gmail account, this connection is working, my next step is…how to connect Mercury to YII2 please?
In the main local you have this:
<?php
return [
'components' => [
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=forum',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
],
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'viewPath' => '@common/mail',
// send all mails to a file by default. You have to set
// 'useFileTransport' to false and configure a transport
// for the mailer to send real emails.
'useFileTransport' => true,
],
],
];
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
// send all mails to a file by default. You have to set
// 'useFileTransport' to false and configure a transport
// for the mailer to send real emails.
'useFileTransport' => false,
// actual email configuration
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'localhost',
//'username' => '',
//'password' => '',
//'port' => '587',
//'encryption' => 'tls',
],
],
…
I have no relay to a external mail-server like you have.
So I’m not sure if you have to make more settings.
(But actually above config should be enough)
Just for info:
You actually don’t need a relay to external mail (gmail) in development environment.
Cou can create local email addresses in mercury like for example:
Then you can setup for example Thunderbird to this mailboxes and have a complete local-mail-system which does not require internet access / external mailbox…