Safe Haskell | None |
---|---|
Language | Haskell98 |
Sending email.
If you're on a system with a working sendmail
then use that.
Otherwise, the stand-alone msmtp
server is easy to set up.
Get msmtp
here: http://msmtp.sourceforge.net
- data Mail = Mail {
- mailFrom :: String
- mailTo :: String
- mailSubject :: String
- mailTime :: UTCTime
- mailTimeZone :: TimeZone
- mailMessageId :: String
- mailBody :: String
- data Mailer
- = MailerSendmail {
- mailerPath :: FilePath
- mailerExtraFlags :: [String]
- | MailerMSMTP {
- mailerPath :: FilePath
- mailerPort :: Maybe Int
- = MailerSendmail {
- createMailWithCurrentTime :: String -> String -> String -> String -> Build Mail
- renderMail :: Mail -> Text
- sendMailWithMailer :: Mail -> Mailer -> Build ()
Documentation
An email message that we can send.
|
An external mailer that can send messages. Also contains mail server info if needed.
MailerSendmail | Send the mail by writing to the stdin of this command.
On many systems the command |
| |
MailerMSMTP | Send mail via MSMTP, which is a stand-alone SMTP sender. This might be be easier to set up if you don't have a real MTA installed. Get it from http://msmtp.sourceforge.net/ |
|
createMailWithCurrentTime Source #
:: String | ' |
-> String | ' |
-> String | Subject line. |
-> String | Message body. |
-> Build Mail |
Create a mail with a given from, to, subject and body. Fill in the date and message id based on the current time. Valid dates and message ids are needed to prevent the mail being bounced by anti-spam systems.
renderMail :: Mail -> Text Source #
Render an email message as a string.