Sebastiaan Koppe píše v Út 29. 09. 2015 v 03:53 +0000: > This library[1] allows you to send multi-part emails with > attachments. > > ``` > Mail email = new Mail; > email.headers["Date"] = Clock.currTime().toRFC822DateTimeString(); > email.headers["Sender"] = "Domain.com Contact Form "; > email.headers["From"] = "\"Example\" <i...@example.com>"; > email.headers["To"] = "\"Bas\" <b...@example.com>"; > email.headers["Subject"] = "My subject"; > import std.stdio : File; > email.setContent( > mailMixed( > mailRelated( > mailAlternative( > > mailHtml("<html><body><center>asdfasdfasdf</center></body></html>"), > mailText("asdfasdfasdf") > ) > ), > > mailAttachment(File("test.png","rb"),"image/png","image.png"), > mailAttachment(cast(immutable(ubyte[]))"You are an > idiot!","plain/text","text.txt") > ) > ); > sendMail(settings, email); > ``` > > [1] http://code.dlang.org/packages/vibemail
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.