Commit e118f144 authored by Steffen Michels's avatar Steffen Michels

Extensions.Email.sendHtmlEmail: avoid too long lines (SMTP allows a mex length...

Extensions.Email.sendHtmlEmail: avoid too long lines (SMTP allows a mex length of 1000 characters only
parent 58a53468
Pipeline #24520 passed with stage
in 5 minutes and 5 seconds
implementation module iTasks.Extensions.Email
import iTasks
import Data.Functor
import Data.Functor, Data.Func
import Text, Text.HTML
sendEmail :: ![EmailOpt] !String ![String] !String !String -> Task ()
......@@ -51,7 +51,11 @@ where
sendHtmlEmail :: ![EmailOpt] !String ![String] !String !HtmlTag -> Task ()
sendHtmlEmail opts sender recipients subject body =
sendEmail [EmailOptExtraHeaders [("content-type", "text/html")]: opts] sender recipients subject (toString body)
sendEmail [EmailOptExtraHeaders [("content-type", "text/html")]: opts] sender recipients subject htmlString
where
// avoid too long lines (SMTP allows a max length of 1000 characters only)
// by inserting a newline (\r\n is required for mails) after each tag
htmlString = replaceSubString ">" ">\r\n" $ toString body
// SMTP messages
smtpHelo = "HELO localhost\r\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment