diff options
Diffstat (limited to 'src/Mail.hs')
-rw-r--r-- | src/Mail.hs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Mail.hs b/src/Mail.hs index bf1516e..1145f9f 100644 --- a/src/Mail.hs +++ b/src/Mail.hs @@ -6,6 +6,8 @@ module Mail import Data.Text (Text) import qualified Data.Text as T +import qualified Data.Text.Lazy as LT +import Data.Text.Lazy.Builder (toLazyText, fromText) import Data.Either (isLeft) import Control.Exception (SomeException, try) @@ -30,8 +32,8 @@ getMimeMail mail = in fromMail { Mime.mailTo = map address . Mail.to $ mail , Mime.mailParts = - [ [ Mime.plainPart . Mail.plainBody $ mail - , Mime.htmlPart . Mail.htmlBody $ mail + [ [ Mime.plainPart . strictToLazy . Mail.plainBody $ mail + , Mime.htmlPart . strictToLazy . Mail.htmlBody $ mail ] ] , Mime.mailHeaders = [("Subject", Mail.subject mail)] @@ -43,3 +45,6 @@ address addressEmail = { Mime.addressName = Nothing , Mime.addressEmail = addressEmail } + +strictToLazy :: Text -> LT.Text +strictToLazy = toLazyText . fromText |