Vibemail - extensions for vibe's Mail class to send multi-part emails with attachments

Daniel Kozak via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Tue Sep 29 01:54:38 PDT 2015


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\" <info at example.com>";
> email.headers["To"] = "\"Bas\" <bas at 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.


More information about the Digitalmars-d-announce mailing list