【问题标题】:How to config mail.php for zimbra mail server in Laravel 5.3?如何在 Laravel 5.3 中为 zimbra 邮件服务器配置 mail.php?
【发布时间】:2017-10-29 12:57:04
【问题描述】:

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

我在config 文件夹中的mail.php

'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文件配置
  • 嗨@BikashP,我更新了我的问题:-)
  • 您应该先在 .env 文件中更改您的电子邮件配置文件

标签: php laravel email laravel-5.3 zimbra


【解决方案1】:

.env 文件看起来像这样

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

【讨论】:

  • 谢谢,我更新了.env 并没有显示任何错误,但是在我的gmail 帐户中没有收到任何邮件。
  • @mySun gmail 有很多限制性规则来获取来自未知来源的电子邮件,并且可能被列入黑名单。
  • gmail 的默认 smtp 端口是 465。
猜你喜欢
  • 2015-06-06
  • 1970-01-01
  • 2017-09-17
  • 2017-08-25
  • 1970-01-01
  • 2018-10-01
  • 1970-01-01
  • 1970-01-01
  • 2015-03-12
相关资源
最近更新 更多