Request to AWS SES API failed. Reason: Error executing "SendRawEmail" in Laravel 10

392 views Asked by At

I am trying to send emails with AWS SES. I followed the Laravel official doc and configured the application. but when I tried to send an email I got the following error. I was using ses as MAIL_MAILER at this time.

Request to AWS SES API failed. Reason: Error executing "SendRawEmail" on "https://email.ap-south-1.amazonaws.com"; AWS HTTP error: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://email.ap-south-1.amazonaws.com.

I assigned AmazonSESFullAccess and AmazonSNSFullAccess permissions directly to my IAM user. I was using aws/aws-sdk-php package with my Laravel application but while trying to solve the issue I tried with aws/aws-sdk-php-laravel package too. But the error remains the same.

Then I generated an SMTP access credential and used it for sending emails. This time it worked.

I want to use the SES config for mail sending with Laravel. It would be really helpful if you please help me to find the issue and solve it.

1

There are 1 answers

0
nasirkhan On

I followed the steps here:

  1. Download the latest certificate from https://curl.se/docs/caextract.html
  2. Open the php.ini file and add the following lines. Here C:\wamp64\php\ssl\cacert.pem is the path of the certificate file. I was using wamp if you are using xampp or something similar, this path might be different.
[curl]
curl.cainfo = "C:\wamp64\php\ssl\cacert.pem"

[openssl]
openssl.cafile = "C:\wamp64\php\ssl\cacert.pem"

  1. Restart web server/apache/fpm php service
  2. Test the mail again, it should work perfectly.

Be sure that you are updating the right php.ini.