From 449f46307e61b56ccddfb7bda248e7197446294d Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Fri, 1 Nov 2019 15:09:46 -0400 Subject: [PATCH] wrong types --- email.d | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/email.d b/email.d index 25dff81..c6acf36 100644 --- a/email.d +++ b/email.d @@ -9,6 +9,9 @@ import std.string; import arsd.characterencodings; +// import std.uuid; +// smtpMessageBoundary = randomUUID().toString(); + // SEE ALSO: std.net.curl.SMTP /// @@ -22,7 +25,7 @@ struct RelayInfo { struct MimeAttachment { string type; /// string filename; /// - const(void)[] content; /// + const(ubyte)[] content; /// string id; /// } @@ -116,16 +119,16 @@ class EmailMessage { message.addAttachment("text/plain", "something.txt", std.file.read("/path/to/local/something.txt")); --- +/ - void addAttachment(string mimeType, string filename, in void[] content, string id = null) { + void addAttachment(string mimeType, string filename, const void[] content, string id = null) { isMime = true; - attachments ~= MimeAttachment(mimeType, filename, content, id); + attachments ~= MimeAttachment(mimeType, filename, cast(const(ubyte)[]) content, id); } /// in the html, use img src="cid:ID_GIVEN_HERE" - void addInlineImage(string id, string mimeType, string filename, in void[] content) { + void addInlineImage(string id, string mimeType, string filename, const void[] content) { assert(isHtml); isMime = true; - inlineImages ~= MimeAttachment(mimeType, filename, content, id); + inlineImages ~= MimeAttachment(mimeType, filename, cast(const(ubyte)[]) content, id); } const(MimeAttachment)[] inlineImages;