From 6ab78e47075e9a60edee16bcd5f302189600352e Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Mon, 25 Oct 2010 04:09:14 -0400 Subject: [PATCH] Update the default headers to include a Content-Transfer-Encoding: 8bit. --- src/Mail.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Mail.hs b/src/Mail.hs index 7f0fd8b..03b7284 100644 --- a/src/Mail.hs +++ b/src/Mail.hs @@ -9,7 +9,8 @@ import Data.List (intercalate) import System.Exit import System.Process import System.Time (CalendarTime(..), ClockTime, getClockTime, Month, toCalendarTime) -import System.IO +import System.IO (hClose, hGetContents, hPutStr) + type Header = String @@ -21,9 +22,13 @@ data Message = Message { headers :: [Header], to :: String } deriving (Eq) +-- |The default headers attached to each message. +-- The MIME junk is needed for UTF-8 to work properly. +-- Note that your mail server should support the 8BITMIME extension. default_headers :: [Header] default_headers = ["MIME-Version: 1.0", - "Content-type: text/plain; charset=UTF-8"] + "Content-Type: text/plain; charset=UTF-8", + "Content-Transfer-Encoding: 8bit"] -- |Showing a message will print it in roughly RFC-compliant -- form. This form is sufficient for handing the message off to -- 2.44.2