wrong types

This commit is contained in:
Adam D. Ruppe 2019-11-01 15:09:46 -04:00
parent 24764d0d51
commit 449f46307e
1 changed files with 8 additions and 5 deletions

13
email.d
View File

@ -9,6 +9,9 @@ import std.string;
import arsd.characterencodings; import arsd.characterencodings;
// import std.uuid;
// smtpMessageBoundary = randomUUID().toString();
// SEE ALSO: std.net.curl.SMTP // SEE ALSO: std.net.curl.SMTP
/// ///
@ -22,7 +25,7 @@ struct RelayInfo {
struct MimeAttachment { struct MimeAttachment {
string type; /// string type; ///
string filename; /// string filename; ///
const(void)[] content; /// const(ubyte)[] content; ///
string id; /// string id; ///
} }
@ -116,16 +119,16 @@ class EmailMessage {
message.addAttachment("text/plain", "something.txt", std.file.read("/path/to/local/something.txt")); 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; 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" /// 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); assert(isHtml);
isMime = true; isMime = true;
inlineImages ~= MimeAttachment(mimeType, filename, content, id); inlineImages ~= MimeAttachment(mimeType, filename, cast(const(ubyte)[]) content, id);
} }
const(MimeAttachment)[] inlineImages; const(MimeAttachment)[] inlineImages;