【问题标题】:OpenSSL Error error on sending mail in laravel5.5在 laravel5.5 中发送邮件时出现 OpenSSL 错误错误
【发布时间】:2018-05-26 03:04:27
【问题描述】:

我正在尝试使用简单的邮件方法在 laravel5.5 中发送邮件,下面是我尝试在控制器中为邮件功能调用的代码:-

Mail::send('emails.special_orders', ['key' => 'value'], function($message)
    {
        $message->to('infinity@gmail.com', 'John Smith')->subject('Welcome!');
    });

在此之后,我还将详细信息放入 .env 文件中,即:-

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=infinity@gmail.com
MAIL_PASSWORD=12345
MAIL_ENCRYPTION=tls

即使在我写的 config/mail.php 文件中:-

'from' => [
    'address' => env('MAIL_FROM_ADDRESS', 'infinity@gmail.com'),
    'name' => env('MAIL_FROM_NAME', 'Example'),
],

当我尝试发送邮件时,我收到一个错误,例如:-

{
"message": "stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:\nerror:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed",
"exception": "ErrorException",
"file": "C:\\xampp\\htdocs\\salon\\vendor\\swiftmailer\\swiftmailer\\lib\\classes\\Swift\\Transport\\StreamBuffer.php",
"line": 94,
"trace": [
    {
        "function": "handleError",
        "class": "Illuminate\\Foundation\\Bootstrap\\HandleExceptions",
        "type": "->"
    },

可能是什么原因?

【问题讨论】:

    标签: php email laravel-5.5


    【解决方案1】:

    尝试使用

    MAIL_PORT=465

    某些系统仍将端口 465 用于 SSL。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-09-02
    • 1970-01-01
    • 2013-11-24
    • 1970-01-01
    • 2015-03-08
    • 1970-01-01
    • 2014-03-22
    • 2014-06-07
    相关资源
    最近更新 更多