Reputation:
I'm using Laravel 5.1 and want to send email but I'm getting this error:
RequestException in CurlFactory.php line 187:
cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
How could I solve this?
My .env file:
MAIL_DRIVER=mailgun
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=mypassword
MAIL_ENCRYPTION=oEontENjBIdIrzaXhk9v9Q
My function in controller:
public function mailContact(ContactRequest $request)
{
$name = $request->input('name');
$email = $request->input('email');
$body = $request->input('body');
$sent = Mail::send('emails.contact', compact('name', 'email', 'body'), function ($message) {
$message->to('[email protected]', 'Admin')->subject('Message');
});
if ($sent) {
return Redirect::back()->withMessage('تشکر از اینکه تماس گرفتید.');
}
return Redirect::back()->withError('متاسفانه ایمیل ارسال نشد.دوباره تلاش کنید');
}
Upvotes: 2
Views: 5895
Reputation: 11
..\php\ext
(curl.cainfo="E:\xampp\php\ext)"php_curl.dll
: curl.cainfo="..\php\ext\cacert.pem"(curl.cainfo="E:\xampp\php\ext\cacert.pem")
Upvotes: 1
Reputation:
I added the cacert.pem file as described in http://codeontrack.com/solve-laravelxamppguzzlehttp-curl-error-60-no-sll-certificate/ but now I'm getting this error:
RequestException in CurlFactory.php line 187:
cURL error 77: error setting certificate verify locations:
CAfile: [pathtothisfile]\cacert.pem
CApath: none (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
Any help?
Upvotes: 0