Cannot send email with amazon ses
-
13-11-2019 - |
문제
I am developing an Codeigniter based website and I need to send emails to people when they are signup up. My server is hosted at Amazon EC2.
I am trying to use their Amazon Simple Email Service and I am using the below library to get that working. I get no error but the sending fails. I am currently in Sandbox mode so I can only send (when it works) to my registered email address but that fails too.
I have configured the library using my AWS credentials. What can be wrong?
This is the library that I am using:
https://github.com/joelcox/codeigniter-amazon-ses
This is my controller code:
// Load the Library
$this->load->library('amazon_ses');
// Configure and send email
$this->amazon_ses->to('registered@email.com');
$this->amazon_ses->subject('Open me!');
$this->amazon_ses->message('<strong>Use HTML</strong>');
if ($this->amazon_ses->send()) {
echo "Successfully sent!";
} else {
echo "Failure!";
}
$this->amazon_ses->debug(TRUE);
해결책
$this->amazon_ses->debug(TRUE);
That debug-line should be used before calling ...->send()
, try this and check what AmazonSES answers:
$this->load->library('amazon_ses');
$this->amazon_ses->to('registered@email.com');
$this->amazon_ses->subject('Open me!');
$this->amazon_ses->message('<strong>Use HTML</strong>');
$this->amazon_ses->debug(TRUE);
print_r( $this->amazon_ses->send() );
제휴하지 않습니다 StackOverflow