installed driver for postmark and ses using : composer require symfony/mailgun-mailer symfony/http-client and composer require aws/aws-sdk-php , cheched the configuration on
mail.php :
eturn [ 'default' => env('MAIL_MAILER', 'smtp'), 'mailers' => [ 'smtp' => [ 'transport' => 'smtp', 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 'port' => env('MAIL_PORT', 587), 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 'username' => env('MAIL_USERNAME'), 'password' => env('MAIL_PASSWORD'), 'timeout' => null, ], 'ses' => [ 'transport' => 'ses', ], 'mailgun' => [ 'transport' => 'mailgun', ], 'postmark' => [ 'transport' => 'postmark', ], 'sendmail' => [ 'transport' => 'sendmail', 'path' => '/usr/sbin/sendmail -bs', ], 'log' => [ 'transport' => 'log', 'channel' => env('MAIL_LOG_CHANNEL', 'stack'), ],
and services.php :
'mailgun' => [
'domain' => env('MAILGUN_DOMAIN'),
'secret' => env('MAILGUN_SECRET'),
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
],
'postmark' => [
'token' => env('POSTMARK_TOKEN'),
],
'ses' => [
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
];
but received the same error 500 afthere requiring password recovery, in log file i can see this :
[2022-12-31 08:28:33] production.ERROR: Class "Aws\Ses\SesClient" not found {"exception":"[object] (Error(code: 0): Class \"Aws\\Ses\\SesClient\" not found at /home/lg2975luca/phpvms/vendor/laravel/framework/src/Illuminate/Mail/MailManager.php:239)
cheching the mailmanager i find this section from 222 to 257 lines :
/**
* Create an instance of the Symfony Amazon SES Transport driver.
*
* @param array $config
* @return \Symfony\Component\Mailer\Bridge\Amazon\Transport\SesApiAsyncAwsTransport
*/
protected function createSesTransport(array $config)
{
$config = array_merge(
$this->app['config']->get('services.ses', []),
['version' => 'latest', 'service' => 'email'],
$config
);
$config = Arr::except($config, ['transport']);
return new SesTransport(
new SesClient($this->addSesCredentials($config)),
$config['options'] ?? []
);
}
/**
* Add the SES credentials to the configuration array.
*
* @param array $config
* @return array
*/
protected function addSesCredentials(array $config)
{
if (! empty($config['key']) && ! empty($config['secret'])) {
$config['credentials'] = Arr::only($config, ['key', 'secret', 'token']);
}
return $config;
}