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

好久不见. 提交于 2019-12-08 07:59:58

问题


I create VPS and install zimbra mail in mail.mywebsite.com and mywebsite.com is in other VPS.

My mail.php in config folder:

'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',

In .env file:

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
  1. I can see mail.mywebsite.com:7520.
  2. My project is Laravel 5.3.

But after send mail, see this error:

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

Can you fix this?

Thank you.


回答1:


.env file will look like this

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


来源:https://stackoverflow.com/questions/44238709/how-to-config-mail-php-for-zimbra-mail-server-in-laravel-5-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!