I've been trying to send emails using Amazon SES SDK with PHP and since I've switched hosts this doesn't work. Here's my script:
$usrMessage = 'hello, just testing';
$usrTo = 'test@test.com';
//Amazon SES - Getting the client ready
require 'amazon/aws.phar';
use Aws\Ses\SesClient;
error_reporting(1);
@ini_set('display_errors', 1);
$client = SesClient::factory(array(
'key' => '[private]',
'secret' => '[private]',
'region' => 'eu-west-1'
));
//End of Amazon SES
$msg = array();
$msg['Source'] = "Test <test@test.com>";
//ToAddresses must be an array
$msg['Destination']['ToAddresses'][] = $usrTo;
$msg['Message']['Subject']['Data'] = "Download Link for your Freebie";
$msg['Message']['Subject']['Charset'] = "UTF-8";
$msg['Message']['Body']['Text']['Data'] ="Text data of email";
$msg['Message']['Body']['Text']['Charset'] = "UTF-8";
$msg['Message']['Body']['Html']['Data'] = $usrMessage;
$msg['Message']['Body']['Html']['Charset'] = "UTF-8";
$result = $client->sendEmail($msg);
//End of Amazon SES Script
As I mentioned, this works fine on localhost and on my old hosting account but it doesn't work on the servers of my new hosting provider. The script doesn't work and no error report is shown, just a blank page...
I tried to echo a line after the second comment but it doesn't show up anything so I suppose it's an issue when requesting the aws.phar (the file is present in the appropriate folder)
I think it might be an issue on the webhosting company's side, does anyone have any ideas?