mercredi 28 janvier 2015

Amazon's Simple Email Service not Working in PHP

I recently made the decision to use Vanilla PHP rather than a framework due mainly to speed reasons and quickly came up with the problem of sending email. I previously sent all my email through amazon's Simple Email Service but right now it doesn't seem to work.


My code looks like:



$ses = new SimpleEmailService($id, $secret,'email-smtp.us-west-2.amazonaws.com');

$m = new SimpleEmailServiceMessage();
$m->addTo($_POST['email']);
$m->setFrom($main_email);
$m->setSubject('Hello, world!');
$m->setMessageFromString('This is the message body.');

$n = $ses->sendEmail($m);
var_dump($n);


I am currentlly using this PHP SES Library http://ift.tt/1nPLBVQ as I do not want to use the Amazon SDK.


The Error I typically get is usually: " Could not resolve host email-stmp.us-...."


UPDATE:


I fixed the typo and now I'm getting a whole shwack of other various errors





Aucun commentaire:

Enregistrer un commentaire