<div dir="ltr"><div class="">
<div class="">
<div class=""><br><br>Hello,<br><br>I'm trying to send an email via <a href="http://mailgun.com">mailgun.com</a> using the hackney and I have some issues sending attachments (which requires multipart).<br><br><a href="https://documentation.mailgun.com/api-sending.html#sending">https://documentation.mailgun.com/api-sending.html#sending</a><br><br>Basically my interest fields are:<br><br> from<br> to<br> subject<br> text<br> attachment File attachment. You can post multiple attachment values. Important: You must use multipart/form-data encoding when sending attachments.<br><br>I tried the following:<br><br>PayloadBase =[<br> {<<"from">>, From},<br> {<<"to">>, To},<br> {<<"subject">>, Subject},<br> {<<"text">>, TextBody},<br> {<<"html">>, HtmlBody}<br>],<br><br>Payload = case Attachment of<br> null -><br> {form, PayloadBase};<br> _-><br> {multipart, PayloadBase ++ [{file, Attachment}]}<br>end,<br><br>But for some reason the attachment is not sent.. Everything else works as expected.<br>I don't see how I can set the filed name to "attachment" as required by mailgun .. at this this is what I suspect beeing wrong<br><br>Silviu<br><br></div>
</div>
</div></div>