Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Amazon SES package
  • Hi All, I've created a package for Amazon Simple Email Service. It provides basic sendemail support via the email driver package. Seems to work in v1.1 but needs this bug quashed before it will work :) https://github.com/unforeseen/fuel-amazon-ses Rob
  • Hi Rob! Thanks very much for this. It is just what I need. I'm having a some trouble getting it working though and I'm hoping you can help me. I'm trying to test sending a very simple plain text email and it fails with no error message. I think I've tracked the problem down to the curl request in driver/ses.php (I'm able to get output up until this point.)
    $curl = \Request::forge('https://email.' . $this->region . '.amazonaws.com/', array(
      'driver' => 'curl',
      'method' => 'post'
    ))->set_header('Content-Type','application/x-www-form-urlencoded')
      ->set_header('X-Amzn-Authorization','AWS3-HTTPS AWSAccessKeyId='.\\\\\\\\\\\\\\\\Config::get('ses.access_key').', Algorithm=HmacSHA256, Signature=' . $signature)
      ->set_header('Date', $date);
      
    $response = $curl->execute($params);
    

    I looked in Fuel's docs for the Request class and it looks like execute() does not take any parameters. So perhaps that is why it's failing? Is the curl request driver baked into Fuel or is that a dependency that I need to install myself? Alternatively, maybe I'm just doing something completely wrong! :) Always totally possible. Thanks in advance for any help you (or anyone else who got this working) can provide.
  • Hey, Double check you're running FuelPHP 1.1, that seems to have that argument. If you think there's an issue with the package, create an issue on github. You'll need to provide enough information for me to reproduce your error. If you could provide the following things on a github issue I might be able to help: 1) how you're calling the email package
    2) debug messages or logs Rob
  • Hey Rob! Thanks for the speedy reply! In the end, it had nothing to do with your SES package. Apparently, Amazon requires all from addresses to be verified with them. (Silly me, I didn't know!) So I was getting a "email address not verified" error. In case it helps anyone, I learned this tidbit from : http://www.techfounder.net/2011/03/23/mis-adventures-with-amazon-simple-email-services-ses/ It might improve the SES package if it threw exceptions when sending fails. Right now, calling $email->send() will return true when sending succeeds, but when it fails, it doesn't even return false - it just fails quietly somewhere in the process. (At least, that's true for the error I was getting.) It would be really great if we could use Fuel's suggested way of handling email exceptions and have it work with SES :
    try
    {
        $email->send();
    }
    catch(\EmailValidationFailedException $e)
    {
        // The validation failed
    }
    catch(\EmailSendingFailedException $e)
    {
        // The driver could not send the email
    }
    

    Thanks again for your work on this! I'm very pleased I can use Fuel's email package with SES now. :)

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion