<div dir="ltr">Hi everyone,<div>I'm having issues with sending email through Amazon SES. I'm using the <b>Network.Mail.Mime.SES</b> package. The error I get is:</div><div><br></div><div><b>email-test-exe: SESException {seStatus = Status {statusCode = 403, statusMessage = "Forbidden"}, seCode = "SignatureDoesNotMatch", seMessage = "The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.", seRequestId = "8ceb250a-0dd3-11e6-892c-4fb1a14d4732"}</b></div><div><p class="">What's confusing is that I'm using the same SES settings in a Rails app as well as a small Rust console program without any issues (it works from the same machine too). The only thing I can think of is that with this Haskell package, I haven't found where to set certain things like the port number (587) and so maybe it's that? Here is a small sample app that illustrates the problem. What am I missing? Thanks.</p><p class=""><br><font face="monospace, monospace"><b>{-# LANGUAGE OverloadedStrings #-}<br>{-# LANGUAGE QuasiQuotes #-}</b></font></p><font face="monospace, monospace"><b>module Main where</b></font></div><div><font face="monospace, monospace"><b><br>import Data.Function ((&))<br>import GHC.Generics<br>import Network.HTTP.Client<br>import Network.HTTP.Client.TLS<br>import Network.Mail.Mime<br>import Network.Mail.Mime.SES<br>import Text.Hamlet (shamlet)<br>import Text.Blaze.Html.Renderer.String (renderHtml)<br><br>import qualified Data.ByteString.Char8 as C8<br>import qualified Data.Text as T<br>import qualified Data.Text.Lazy as LT<br><br>main :: IO ()<br>main = do<br>  manager <- newManager tlsManagerSettings<br>  let sesConfig = SES { sesFrom = C8.pack "<a href="mailto:de@somewhere.com">de@somewhere.com</a>",<br>                        sesTo = [ C8.pack "<a href="mailto:someone.else@somewhereelse.com">someone.else@somewhereelse.com</a>" ],<br>                        sesAccessKey = "SOMEAWSACCESSKEY",<br>                        sesSecretKey = "ANEVENLONGERAWSSECRETKEY1234567890",<br>                        sesRegion = usEast1 }<br>      email = Mail { mailFrom = Address (Just "David Escobar") "<a href="mailto:de@somewhere.com">de@somewhere.com</a>",<br>                     mailTo = [ Address (Just "Someone Else") "<a href="mailto:someone.else@somewhereelse.com">someone.else@somewhereelse.com</a>" ],<br>                     mailParts = [ [ htmlPart testEmail ] ],<br>                     mailCc = [],<br>                     mailBcc = [],<br>                     mailHeaders = [ ("subject", "Some Test Email"),<br>                                     ("Content-Type", "text/html; charset=ISO-8859-1") ] }<br>  renderSendMailSES manager sesConfig email<br><br><br>testEmail :: LT.Text<br>testEmail =<br>  let rows = [ [ "1", "2", "3" ], [ "4", "5", "6" ]]<br>  in<br>    renderHtml [shamlet|<br>      $doctype 5<br>      <html><br>        <body><br>          <table style="border: 1px solid black; border-collapse: collapse; margin: 25px 0; width: 100%;"><br>            <tr><br>              <th style="background-color: #072a2d; color: white; font-weight: bold; border-right: 1px solid white; padding: 5px 10px; width: 33%;"><br>                Column 1<br>              <th style="background-color: #072a2d; color: white; font-weight: bold; border-right: 1px solid white; padding: 5px 10px; width: 33%;"><br>                Column 2<br>              <th style="background-color: #072a2d; color: white; font-weight: bold; border-right: 1px solid white; padding: 5px 10px; width: 33%;"><br>                Column 3<br>            $forall row <- rows<br>              <tr style="background-color: #f8f9ee;"><br>                <td style="border: 1px solid black; padding: 5px 10px; text-align: left; width: 33%;"><br>                  #{T.pack $ row !! 0}<br>                <td style="border: 1px solid black; padding: 5px 10px; text-align: left; width: 33%;"><br>                  #{T.pack $ row !! 1}<br>                <td style="border: 1px solid black; padding: 5px 10px; text-align: left; width: 33%;"><br>                  #{T.pack $ row !! 2}<br>    |] & LT.pack</b></font></div><div><br></div></div>