Adam D.Ruppe píše v Út 29. 09. 2015 v 12:05 +0000: > On Tuesday, 29 September 2015 at 08:54:39 UTC, Daniel Kozak wrote: > > Wow, I need something like this 3 weeks ago, but I dont have > > time to implement this myself, so I end up with phpMailer. Now > > I can switch my little e-mailing system to Dlang. Thank you. > > If you ever need something in D, ask me first.... there's a good > chance I've written it! > > https://github.com/adamdruppe/arsd/blob/master/email.d > > ....there's also a good chance I haven't documented it too > though... > > but the way mine works is something like: > > --- > import arsd.email; > void main() { > auto message = new EmailMessage(); > message.to ~= "[email protected]"; > message.from = "[email protected]"; > message.subject = "test"; > message.setHtmlBody("<img src=\"cid:amazing\" > /><b>test</b>"); > message.addAttachment("text/csv", "cool.csv", > "whoa,mang"); > message.addAttachment("text/wtf", "whoa.wtf", "WTF\nMAN"); > message.addInlineImage("amazing", "image/png", > "black.png", > import("black.png")); > message.send(); > } > --- > > > The send method uses std.net.curl to do the actual sending (the > smtp connection information is a default argument to the method. > > > My lib also has a function: > > void email(string to, string subject, string message, string > from, RelayInfo mailServer = RelayInfo("smtp://localhost")) {} > > > for sending a plain text email quickly and easily, similar to > PHP's mail function.
Thanks, I will look at it. I only look at code.dlang.org. It would be nice to have all of yours stuff on code.dlang.org.
