如何在 Laravel 5.3 中为 zimbra 邮件服务器配置 mail.php?

How to config mail.php for zimbra mail server in Laravel 5.3?

我在 mail.mywebsite.com 中创建 VPS 并安装 zimbra mail,而 mywebsite.com 在其他 VPS 中。

我的 mail.phpconfig 文件夹中:

'driver' => 'smtp',
'host' => 'mail.mywebsite.com',
'from' => [
    'address' => 'customers@mywebsite.com',
    'name' => 'mywebsite.com'
],
'encryption' => env('MAIL_ENCRYPTION', 'No Encryption'),
'username' => 'info@mywebsite.com',
'password' => '*******',
'sendmail' => '/usr/sbin/sendmail -bs',

.env 文件中:

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
  1. 我能看到mail.mywebsite.com:7520
  2. 我的项目是Laravel 5.3

但是发送邮件后,看到这个错误:

Swift_TransportException in StreamBuffer.php line 268:
Connection could not be established with host mail.mywebsite.com[Connection timed out #110]

你能解决这个问题吗?

谢谢。

.env 文件将如下所示

MAIL_DRIVER=smtp
MAIL_HOST=smtp host
MAIL_PORT=25
MAIL_USERNAME=user_name
MAIL_PASSWORD=password
MAIL_ENCRYPTION=TLS