Hiawatha サーバーで実行されている AWS SES アカウント (本番モード) を介して CakePHP 3 を使用してメールを送信しようとすると、3 回目または場合によっては最初の試みの後に、「Internal Server Error 500」が表示されます。
これが私のphpコードです:
public function sendmail()
{
$email = new Email();
$email->transport('SES');
try {
$res = $email->from(['account@example.com' => 'Name'])
->to(['receiver@hotmail.com' => 'Receiver'])
->subject('Test mail')
->send('some text');
} catch (Exception $e) {
$this->Flash->error('Error. Please, try again.');
echo 'Exception : ', $e->getMessage(), "\n";
return $this->redirect('/');
}
$this->Flash->success('Ok. You will receive a confirmation mail');
return $this->redirect('/');}
これがトランスポート構成です
'EmailTransport' => [
'SES' => [
'host' => 'email-smtp.eu-west-1.amazonaws.com',
'port' => 25,
'timeout' => 60,
'username' => 'ASDFASADQWE',
'password' => 'FSDFDSFDSFSEREWRWERWER',
'tls' => true,
'className' => 'Smtp'
],
ポート 465 と 587 が最初の試行で機能しない
したがって、基本的に、問題が CakePHP、AWS SES、またはサーバー上の何らかの構成に起因するものかどうかを特定できません。
お勧めいただきありがとうございます。