SSPkrolik / smtp

SMTP library for D
MIT License
8 stars 6 forks source link

email with images... #8

Closed itiu closed 8 years ago

itiu commented 8 years ago

to form letters with pictures, in structure SmtpAttachment added field cid:

example:

auto   bytes = cast(ubyte[]) read("logo.jpg");
auto attachment = SmtpAttachment("logo.jpg", bytes, "logo_attachment_id");
string message_body = "<h3>Title</h3><h3><img src=\"logo_attachment_id\" alt=\"logo\" /></h3>";
auto message = SmtpMessage(Recipient(email_from, "From"), [ Recipient(email_to, "To") ], subject, message_body, email_reply_to);
message.attach(attachment);
SSPkrolik commented 8 years ago

@ValeriyBushenev Thx!