Netsendmail puts \n\n between each line of mails

Richard Jones <[email protected]> Tue, 1 Feb 2005 13:47:27 +0000
Newsgroups gmane.comp.lang.ocaml.lib.net.devel
Message-ID <[email protected]>
Small test program which demonstrates this is below.  You'll need to
change the "[email protected]" to be your real email address.

It basically inserts double \n\n between each line, which means that
MIME breaks completely.  So for example the mail I receive after
running this program contains:

--------------------------------=__E94E39E7073C8164<&>;0000000000

Content-type: text/plain; charset="ISO-8859-1"

Content-transfer-encoding: quoted-printable



Body of main part


Any idea why?

Rich.

----------------------------------------------------------------------
(*ocamlc -I +pcre -I +netstring unix.cma pcre.cma netstring.cma sendmail.ml -o sendmail*)

let to_addrs = [ "Your Name", "[email protected]" ]

let csv_filename = "/etc/motd"

let attachments =
  [ Netsendmail.wrap_attachment
      ~content_type:("text/tab-separated-values", [])
      (new Netmime.file_mime_body csv_filename) ]
let msg =
  Netsendmail.compose ~to_addrs ~attachments
    ~subject:"Subject line" "Body of main part";;

Netsendmail.sendmail msg

-- 
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Team Notepad - intranets and extranets for business - http://team-notepad.com


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl