This issue is about the two following functions of the Mt module :
val multipart : rng:'g rng -> ?header:Header.t -> ?boundary:string -> part list -> multipart
val make : Header.t -> 'x body -> 'x -> t
There are two ways of building the "same" email with predefined header header.
More intuitive choice
let mail =
Mt.multipart ~rng:Mt.rng parts
|> Mt.make header Mt.multi
Second choice
let mail =
Mt.multipart ~header ~rng:Mt.rng parts
|> Mt.make Header.empty Mt.multi
The issue is the following: the multipart function checks the input header for the content type and adds it if necessary. So the first solution does not work properly : the final headers can have multiple content-type headers (the one in the predefined header and the added one).
But the first solution is clearly suggested by the API as header is an optional argument for multipart but not for make.
I think an easy solution will be to remove the header argument of the make function.
This issue is about the two following functions of the
Mtmodule :There are two ways of building the "same" email with predefined header
header.More intuitive choice
Second choice
The issue is the following: the
multipartfunction checks the input header for the content type and adds it if necessary. So the first solution does not work properly : the final headers can have multiple content-type headers (the one in the predefinedheaderand the added one).But the first solution is clearly suggested by the API as
headeris an optional argument formultipartbut not formake.I think an easy solution will be to remove the header argument of the
makefunction.