CodeIgniter Forums
What is the trick to get SMTP to work on AWS SES? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11)
+--- Thread: What is the trick to get SMTP to work on AWS SES? (/showthread.php?tid=88077)



What is the trick to get SMTP to work on AWS SES? - cx3700 - 07-15-2023

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.


RE: What is the trick to get SMTP to work on AWS SES? - kenjis - 07-16-2023

$email->SMTPCrypto = 'tls';


RE: What is the trick to get SMTP to work on AWS SES? - cx3700 - 07-16-2023

I have tried both TLS and SSL, 465 and 587. I verified the SMTP credentials and endpoint, but I still get this error.


RE: What is the trick to get SMTP to work on AWS SES? - secretivetwice - 11-26-2023

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.


RE: What is the trick to get SMTP to work on AWS SES? - zee - 11-26-2023

Hey,
seems to be a typo there "tls" not "tsl"

cheers