From 376e4ed1f16a0fe5a4d100877c618d85e20a9b8f Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Mon, 25 Oct 2010 02:08:36 -0400 Subject: [PATCH] Add default headers for MIME-Version and Content-type to each outgoing message. --- src/Mail.hs | 4 ++++ src/Main.hs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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, -- 2.43.2