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.

If people like this and would like to see it released outside of Yesod, I can easily do so.

Jeremy:

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.

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.

Michael

[1] http://github.com/snoyberg/yesod/blob/master/Yesod/Mail.hs
[2] http://github.com/snoyberg/yesod/blob/master/mail.hs

On Fri, Aug 20, 2010 at 1:33 AM, Clint Moore <cmoore@wamboli.com> wrote:
I know it probably sounds terrible, but we've gotten away with using
runInteractiveProcess + sendmail for all of our email.  So far it has
worked pretty well.

That said, if you end up writing such a thing, we would be interested
in testing it.

On Thu, Aug 19, 2010 at 11:43 AM, Michael Snoyman <michael@snoyman.com> wrote:
> Hey all,
> I'm wondering what people do in general for sending email, especially from
> web apps. So far, I've written some basic modules in my apps that wrap
> around the sendmail executable on the system. Are there packages on Hackage
> that people would recommend?
> As long as I'm bringing this up, I think I nice email system would offer
> built in support for creating multipart messages. Bonus points would be to
> automatically create a text/plain version from an HTML version. If no one
> knows of prior art on this, I might try to implement it as a module in
> Yesod.
> Michael
> _______________________________________________
> web-devel mailing list
> web-devel@haskell.org
> http://www.haskell.org/mailman/listinfo/web-devel
>
>