We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f003ea2 commit 9330a7bCopy full SHA for 9330a7b
src/mime.jl
@@ -53,17 +53,24 @@ function mime_multipart(header::AbstractString, parts::Array)
53
for (filename, content_type, content) in parts
54
55
if filename != ""
56
- mime *= "Content-Disposition: attachment; filename=$filename\n"
+ mime *= "Content-Disposition: attachment;\n filename=$filename\n"
57
+ end
58
+
59
+ if isa(content, AbstractString)
60
+ mime *= "Content-Transfer-Encoding: binary\n"
61
+ else
62
+ mime *= "Content-Transfer-Encoding: base64\n"
63
+ b64 = base64encode(content)
64
+ b64 = [b64[i:min(length(b64),i+75)] for i in 1:76:length(b64)]
65
+ content = join(b64, "\n")
66
end
67
68
mime *= """Content-Type: $content_type
- Content-Transfer-Encoding: binary
69
70
$content
71
--$boundary
72
"""
73
-
74
return mime
75
76
0 commit comments