renderParts error in mime-mail package
<p>I am trying to figure out how to send an email message through <code>AWS SES</code> using <a href="https://github.com/yesodweb/yesod/blob/master/demo/auth/email_auth_ses_mailer.hs#L114" rel="nofollow"><code>mime-mail-ses</code></a> package. I used <code>renderSendMailSES</code> example from <a href="https://github.com/yesodweb/yesod/blob/master/demo/auth/email_auth_ses_mailer.hs#L114" rel="nofollow"><code>Yesod wiki</code></a> to try the code below - I am using <code>renderMail</code> here to debug the error in <code>mail</code> body validation:</p>

<pre><code>    *Main&gt; let textPart = Part {partType = "text/plain; charset=utf-8", 
partEncoding = None, partFilename = Nothing, partHeaders = [], partContent = "Testing"}
    *Main&gt; let htmlPart = Part { partType = "text/html; charset=utf-8", 
partEncoding = None, partFilename = Nothing, partHeaders = [], partContent = "Testing"}
    *Main&gt; renderMail' (emptyMail $ Address Nothing "noreply@example.com") {
 mailTo = [Address Nothing "test@example.com"] , mailHeaders =  [ ("Subject", 
"Testing email address")], mailParts = [[textPart, htmlPart]]}
</code></pre>

<p>I get this error:</p>

<pre><code>*** Exception: renderParts called with null parts
</code></pre>

<p>This is quite head-scratcher because the above example doesn't seem any different from <code>Yesod Wiki</code>. I can't add attachment either because of the above error. An attachment if I am not mistaken, will look like this for <code>mailParts</code>:</p>

<pre><code>mailParts = [[textPart,htmlPart],[attachment1]]
</code></pre>

<p>I looked in the code that is causing the error but can't figure out what is wrong.</p>

<p>I will very much appreciate pointers to resolve this error.</p>