<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body style="background-color: rgb(255, 255, 255); color: rgb(0, 0,
0);" text="#000000" bgcolor="#FFFFFF">
Hi David,<br>
<br>
I'm using almost exact function as you wrote below and it works
without problems. Using mime-mail-ses-0.3.2.2.<br>
<p>However, it works on E2 instance. Don't know if that matters.</p>
<p>Stupid question, but have you double checked keys? <br>
</p>
<p>I received similar errors when keys were not correct (they were
not hardcoded, but fetched).</p>
<p><br>
</p>
<p>br,</p>
<p>vlatko<br>
</p>
<br>
<blockquote style="border-left: 2px solid #330033 !important;
border-right: 2px solid #330033 !important; padding: 0px 15px 0px
15px; margin: 8px 2px;"
cite="mid:CANAca7jsFrWcNtk9B_RKsKDpjmGbwyhstLKa+xsXO6n_epH8Ww@mail.gmail.com"
type="cite"><!--[if !IE]><DIV style="border-left: 2px solid #330033; border-right: 2px solid #330033; padding: 0px 15px; margin: 2px 0px;"><![endif]--><span
style="color:#000000;" class="headerSpan">
<div class="moz-cite-prefix">-------- Original Message --------<br>
Subject: Re: [Haskell-cafe] Amazon SES email issues<br>
From: David Escobar <a class="moz-txt-link-rfc2396E" href="mailto:davidescobar@ieee.org"><davidescobar@ieee.org></a><br>
To: David Johnson <a class="moz-txt-link-rfc2396E" href="mailto:djohnson.m@gmail.com"><djohnson.m@gmail.com></a><br>
Cc: Haskell Cafe <a class="moz-txt-link-rfc2396E" href="mailto:haskell-cafe@haskell.org"><haskell-cafe@haskell.org></a><br>
Date: 30/04/16 09:10<br>
</div>
<br>
<br>
</span>
<div dir="ltr">David, thanks for the suggestion. Are there any
examples on how to send an email? I've looked through several of
the Haskell email packages and have been able to figure out
their APIs easily enough, but this one seems incredibly complex
- almost seem to have to know the internals of SES to use it
effectively and the documentation / examples are scant.</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Fri, Apr 29, 2016 at 7:07 AM, David
Johnson <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:djohnson.m@gmail.com" target="_blank">djohnson.m@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">I think that package is using an outdated
version of the AWS Signing algorithm.<br>
<pre><span><font color="#008080">"AWS3-HTTPS"
</font><font face="arial, sans-serif"><span style="white-space:normal">I think AWS is migrating most of their APIs (who have domains / services created after a certain date) to require using the V4 Signature algorithm for all API requests.
The amazonka-ses would probably work better.</span></font></span></pre>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">
<div>
<div class="h5">On Fri, Apr 29, 2016 at 1:45 AM, David
Escobar <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:davidescobar@ieee.org"
target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:davidescobar@ieee.org">davidescobar@ieee.org</a></a>></span>
wrote:<br>
</div>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div class="h5">
<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>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><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 moz-do-not-send="true"
href="mailto:de@somewhere.com"
target="_blank">de@somewhere.com</a>",<br>
sesTo = [ C8.pack
"<a moz-do-not-send="true"
href="mailto:someone.else@somewhereelse.com"
target="_blank">someone.else@somewhereelse.com</a>"
],<br>
sesAccessKey =
"SOMEAWSACCESSKEY",<br>
sesSecretKey =
"ANEVENLONGERAWSSECRETKEY1234567890",<br>
sesRegion =
usEast1 }<br>
email = Mail { mailFrom = Address
(Just "David Escobar") "<a
moz-do-not-send="true"
href="mailto:de@somewhere.com"
target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:de@somewhere.com">de@somewhere.com</a></a>",<br>
mailTo = [ Address
(Just "Someone Else") "<a
moz-do-not-send="true"
href="mailto:someone.else@somewhereelse.com"
target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:someone.else@somewhereelse.com">someone.else@somewhereelse.com</a></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>
<br>
</div>
</div>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a moz-do-not-send="true"
href="mailto:Haskell-Cafe@haskell.org"
target="_blank">Haskell-Cafe@haskell.org</a><br>
<a moz-do-not-send="true"
href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe"
rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
<br>
</blockquote>
</div>
<span class="HOEnZb"><font color="#888888"><br>
<br clear="all">
<div><br>
</div>
-- <br>
<div>Cell: <a moz-do-not-send="true"
href="tel:1.630.740.8204" value="+16307408204"
target="_blank">1.630.740.8204</a></div>
</font></span></div>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Haskell-Cafe mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a>
<a class="moz-txt-link-freetext" href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a>
</pre>
<!--[if !IE]></DIV><![endif]--></blockquote>
<br>
</body>
</html>