发邮件一直不成功,请大侠们帮我看一下stream_socket_enable_crypto():
我在 centos 和 mac 下都不行,求大家帮忙,我在网上查了就是不行
对了,如果把驱动改成Mail 也发不成功,一并求解
Whoops, looks like something went wrong.
1/1
ErrorException in StreamBuffer.php line 95:
stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
in StreamBuffer.php line 95
at HandleExceptions->handleError('2', 'stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed', '/Users/jack/Desktop/Project/php/trunk/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php', '95', array())
对了,如果把驱动改成Mail 也发不成功,一并求解
$data = array('name' => 'Jordan');
Mail::send('emails.register_active', $data, function($message)
{
$message->to('keycou@163.com')
->subject('Hi there! Laravel sent me!');
});
Whoops, looks like something went wrong.
1/1
ErrorException in StreamBuffer.php line 95:
stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
in StreamBuffer.php line 95
at HandleExceptions->handleError('2', 'stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed', '/Users/jack/Desktop/Project/php/trunk/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php', '95', array())
9 个回复
raisinli
赞同来自:
看看图你就知道了。
raisinli
赞同来自:
keycou
赞同来自:
邮件代码:
Mail::send('emails.register_active', array('name' => 'test user'), function($message)
{
$message->to('85636009@qq.com', 'John Smith')->subject('Welcome!');
});
模板:
emails/register_active.blade.php
你好,{{ $name }}
配置:
.env
MAIL_DRIVER=smtp
MAIL_HOST=smtp.163.net
MAIL_PORT=25
MAIL_USERNAME=keycou@163.com
MAIL_PASSWORD=*******
config/mail.php
<?php
return [
'driver' => 'smtp',
'host' => 'smtp.163.com',
/*
'port' => 25,
'from' => ['address' => 'keycou@163.com', 'name' => 'lichaogang'],
'encryption' => 'tls',
'username' => 'keycou@163.com',
'password' => '**********',
'sendmail' => '/usr/sbin/sendmail -bs',
'pretend' => false,
];
raisinli
赞同来自:
raisinli
赞同来自:
你可以把域名指向。 http://ym.163.com 具体你的看里面的介绍,可以申请自己的邮局,只有这样才可以使用。
raisinli
赞同来自:
申请地址: http://ym.163.com 这样对配置服务器和做一些测试都可以的。
raisinli
赞同来自:
raisinli
赞同来自:
问题已经解决了,是邮件服务器的问题。本身程序不存在任何SMTP的配置错误。
求_败
赞同来自: