<div dir="ltr">I've written a module in Yesod for email[1], but it doesn't actually rely on any Yesod features, so could be factored out easily. I've also written a sample program[2] to go along with it. The main feature is to be able to easily generate multi-part emails. It also includes some code to send an email via createProcess/sendmail.<div>
<br></div><div>If people like this and would like to see it released outside of Yesod, I can easily do so.</div><div><br></div><div>Jeremy:</div><div><br></div><div>It seems strange that SMTPClient uses a String to represent the message body. My module uses a lazy ByteString. I suppose you could always just do a Lazy.Char8.unpack to get the results from my module into SMTPClient.</div>
<div><br></div><div>I like the idea of using markdown, I might try that in the future. As far as the templating, I'm not even touching that one: Yesod.Mail deals exlusively with lazy ByteStrings, and you can generate those however you see fit.</div>
<div><br></div><div>Michael<br><div><br></div><div>[1] <a href="http://github.com/snoyberg/yesod/blob/master/Yesod/Mail.hs">http://github.com/snoyberg/yesod/blob/master/Yesod/Mail.hs</a></div><div><a href="http://github.com/snoyberg/yesod/blob/master/Yesod/Mail.hs"></a>[2] <a href="http://github.com/snoyberg/yesod/blob/master/mail.hs">http://github.com/snoyberg/yesod/blob/master/mail.hs</a><br>
<br><div class="gmail_quote">On Fri, Aug 20, 2010 at 1:33 AM, Clint Moore <span dir="ltr"><<a href="mailto:cmoore@wamboli.com">cmoore@wamboli.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I know it probably sounds terrible, but we've gotten away with using<br>
runInteractiveProcess + sendmail for all of our email. So far it has<br>
worked pretty well.<br>
<br>
That said, if you end up writing such a thing, we would be interested<br>
in testing it.<br>
<div><div></div><div class="h5"><br>
On Thu, Aug 19, 2010 at 11:43 AM, Michael Snoyman <<a href="mailto:michael@snoyman.com">michael@snoyman.com</a>> wrote:<br>
> Hey all,<br>
> I'm wondering what people do in general for sending email, especially from<br>
> web apps. So far, I've written some basic modules in my apps that wrap<br>
> around the sendmail executable on the system. Are there packages on Hackage<br>
> that people would recommend?<br>
> As long as I'm bringing this up, I think I nice email system would offer<br>
> built in support for creating multipart messages. Bonus points would be to<br>
> automatically create a text/plain version from an HTML version. If no one<br>
> knows of prior art on this, I might try to implement it as a module in<br>
> Yesod.<br>
> Michael<br>
</div></div>> _______________________________________________<br>
> web-devel mailing list<br>
> <a href="mailto:web-devel@haskell.org">web-devel@haskell.org</a><br>
> <a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
><br>
><br>
</blockquote></div><br></div></div></div>