From: Michael Orlitzky Date: Mon, 25 Oct 2010 06:08:36 +0000 (-0400) Subject: Add default headers for MIME-Version and Content-type to each outgoing message. X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Fhalcyon.git;a=commitdiff_plain;h=376e4ed1f16a0fe5a4d100877c618d85e20a9b8f Add default headers for MIME-Version and Content-type to each outgoing message. --- diff --git a/src/Mail.hs b/src/Mail.hs index 3304d76..c93a6cf 100644 --- a/src/Mail.hs +++ b/src/Mail.hs @@ -22,6 +22,10 @@ data Message = Message { headers :: [Header], to :: String } deriving (Eq) +default_headers :: [Header] +default_headers = ["MIME-Version: 1.0", + "Content-type: text/plain; charset=UTF-8"] + -- |Showing a message will print it in roughly RFC-compliant -- form. This form is sufficient for handing the message off to -- sendmail. diff --git a/src/Main.hs b/src/Main.hs index 7025b4b..de20989 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -138,7 +138,7 @@ main = do case from_address of Nothing -> Nothing Just fromaddr -> - Just (Message { headers = [], + Just (Message { headers = default_headers, body = "", subject = "", to = toaddr,