What is the trick to get SMTP to work on AWS SES? |
My code:
$email = \Config\Services::email(); $email->protocol = 'smtp'; $email->SMTPCrypto = 'tsl'; $email->SMTPHost = 'email-smtp.us-west-2.amazonaws.com'; $email->SMTPUser = 'xxxx'; $email->SMTPPass = xxxx'; $email->SMTPPort = 587; $email->newline = "\r\n"; $email->setFrom('[email protected]', 'Company Name'); $email->setTo('[email protected]'); $email->setSubject('Email Test'); $email->setMessage('Testing the email class.'); $email->send(false); echo $email->printDebugger(); The response: Unable to send email using SMTP. Your server might not be configured to send mail using this method. The email address I am sending from exists on the server, which is setup through Plesk.
$email->SMTPCrypto = 'tls';
I have tried both TLS and SSL, 465 and 587. I verified the SMTP credentials and endpoint, but I still get this error.
Sorry for commenting a bit late, but I wanted to ask if the error has been resolved properly now. Is there any way to fix it because I just now encountered this situation.
|
Welcome Guest, Not a member yet? Register Sign In |