[Haskell-cafe] Re: Should Yesod.Mail be a separate package?

Jeremy Shaw jeremy at n-heptane.com
Sun Oct 17 13:07:08 EDT 2010


On Sun, Oct 17, 2010 at 10:14 AM, Michael Snoyman <michael at snoyman.com> wrote:

> I'm sure people would love to see built-in support for serving over
> SMTP, but I think that's more appropriate for a different package.
> Proper SMTP support will also include SSL/TLS support, which will
> require even more dependencies.

SMTPClient,

http://hackage.haskell.org/package/SMTPClient-1.0.3

can be used to send mail via SMTP to a smart host. It is still based
on 'String', but it is a start. To send a simple message you can do:

 import Network.SMTP.Simple
 import System.IO

 main :: IO ()
 main = do
     sendSimpleMessages (hPutStrLn stderr) "10.2.23.11" "example.com" [message]
     where message = SimpleMessage
                         [NameAddr (Just "John Doe") "johnd at example.com"]
                         [NameAddr (Just "Team") "team at exmaple.com"]
                         "My test email using Network.SMTP.Simple"
                         "Hi, this is a test email which uses SMTPClient."

I wonder what it would take to make it so that the message body could
be multipart mime...

- jeremy


More information about the Haskell-Cafe mailing list