我正在尝试使用MS Exchange作为smtp服务器发送电子邮件,该电子邮件不需要任何身份验证,也不需要加密。这是我的(.env)文件:
MAIL_DRIVER=smtp
MAIL_HOST=servername
MAIL_PORT=25
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
,mail.php配置文件如下所示:
return [
/*
|--------------------------------------------------------------------------
| Mail Driver
|--------------------------------------------------------------------------
*/
'driver' => env('MAIL_DRIVER', 'smtp'),
/*
|--------------------------------------------------------------------------
| SMTP Host Address
|--------------------------------------------------------------------------
*/
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
/*
|--------------------------------------------------------------------------
| SMTP Host Port
|--------------------------------------------------------------------------
*/
'port' => env('MAIL_PORT', 25),
/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
*/
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'email@domain.de'),
'name' => env('MAIL_FROM_NAME', 'Some name'),
],
/*
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
*/
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
/*
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
*/
'username' => env(null),
'password' => env(null),
/*
|--------------------------------------------------------------------------
| Sendmail System Path
|--------------------------------------------------------------------------
*/
'sendmail' => '/usr/sbin/sendmail -bs',
/*
|--------------------------------------------------------------------------
| Markdown Mail Settings
|--------------------------------------------------------------------------
*/
'markdown' => [
'theme' => 'default',
'paths' => [
resource_path('views/vendor/mail'),
],
],
|--------------------------------------------------------------------------
| Log Channel
|--------------------------------------------------------------------------
'log_channel' => env('MAIL_LOG_CHANNEL'),
];
此应用程序在带有IIS8的MS Windows Server 2012 R2上运行,在我的Win10系统上本地运行正常,但是在服务器上部署时,它开始出现此错误:
当我在smtp服务器上进行telnet时,会显示以下内容:
可能是什么问题?
答案 0 :(得分:0)
我在swiftmailer版本6.2.3中遇到了相同的问题。如果我尝试发送类似gaga@server.com的电子邮件,则会发生错误。 gaga未知,server.com存在。
->所以我切换回了swiftmailer 6.02版。