<div dir="ltr">Hi Brendan. Yes, I use port 587 in my other apps and it's worked fine there. When using Network.Mail.Mime.SES, I haven't found a place to explicitly set it though. Perhaps it assumes 587 by default? I've also used the same keys but no success there. I tried flipping them around, and got an authentication error, so I know the original order was correct.<div><br></div><div>The only other thing I'm doing in my Rust program is setting the authentication mechanism to PLAIN and there's also an option to always encrypt which I've set as well. There doesn't seem to be an exact equivalent set of options in Network.Mail.Mime.SES, but perhaps it also does those by default?</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Apr 30, 2016 at 12:59 AM, Brendan Hay <span dir="ltr"><<a href="mailto:brendan.g.hay@gmail.com" target="_blank">brendan.g.hay@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">No examples for amazonka-ses yet unfortunately. There are brief examples in the source repository for other services: <a href="https://github.com/brendanhay/amazonka/tree/develop/examples/src/Example" target="_blank">https://github.com/brendanhay/amazonka/tree/develop/examples/src/Example</a><div>I'll add something for SES shortly.<br><div><br></div><div><div>The amazonka-* library operations and types map directly to the AWS documentation - so you will need to a) have an understanding of the product/service offering b) be willing to reference the relevant AWS documentation.</div><div>Each amazonka-* library can be considered a 'low level' interface to the related Amazon service, with a unified AuthN/AuthZ (newEnv) and request/response (send) interface available in the main 'amazonka' library.</div></div><div><br></div><div>For your example above, as the older AWS APIs tend to have fairly unhelpful error messages - your only option unfortunately is trial and error. The keys are naturally the first thing to check, make sure you haven't mixed up the access and secret keys by accident and that they are in fact the same keys being used by your equivalent Rust program.</div></div><div><br></div><div>Just for clarification - you mentioned port 587, are you attempting to communicate with a non-standard endpoint?</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On 30 April 2016 at 09:10, David Escobar <span dir="ltr"><<a href="mailto:davidescobar@ieee.org" target="_blank">davidescobar@ieee.org</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">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><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 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.<br><br>The amazonka-ses would probably work better.</span></font></span></pre></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Fri, Apr 29, 2016 at 1:45 AM, David Escobar <span dir="ltr"><<a href="mailto:davidescobar@ieee.org" target="_blank">davidescobar@ieee.org</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><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 href="mailto:de@somewhere.com" target="_blank">de@somewhere.com</a>",<br> sesTo = [ C8.pack "<a 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 href="mailto:de@somewhere.com" target="_blank">de@somewhere.com</a>",<br> mailTo = [ Address (Just "Someone Else") "<a href="mailto:someone.else@somewhereelse.com" target="_blank">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>
<br></div></div>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a 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><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div>Cell: <a href="tel:1.630.740.8204" value="+16307408204" target="_blank">1.630.740.8204</a></div>
</font></span></div>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a 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><br></div>
</div></div></blockquote></div><br></div>