我创建VPS并在mail.mywebsite.com中安装zimbra mail
,mywebsite.com在其他VPS中。
我在mail.php
文件夹中的config
:
'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
mail.mywebsite.com:7520
。Laravel 5.3
。但发送邮件后,请看到此错误:
Swift_TransportException in StreamBuffer.php line 268:
Connection could not be established with host mail.mywebsite.com[Connection timed out #110]
你能解决这个问题吗?
谢谢。
答案 0 :(得分:3)
.env文件将如下所示
MAIL_DRIVER=smtp
MAIL_HOST=smtp host
MAIL_PORT=25
MAIL_USERNAME=user_name
MAIL_PASSWORD=password
MAIL_ENCRYPTION=TLS