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

Sebastiaan Koppe via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Tue Sep 29 02:05:08 PDT 2015


On Tuesday, 29 September 2015 at 07:24:48 UTC, Russel Winder 
wrote:
> This code looks so similar to the equivalent in Python, it is 
> great. Does it need Vibe underneath it though to work, or is 
> this a package that can sit separately and just use sockets to 
> connect to the SMTP server as with Python?

It only depends on vibe's Mail class.

The only function that interacts with the Mail class is this one:

```
void setContent(MailPart)(Mail email, MailPart part)
	if (isMailPart!MailPart)
{
	foreach(key, value; part.headers)
		email.headers[key] = value;

	import std.conv : text;
	email.bodyText = part.content.text;
}
```

Which is rather trivial to port.

Having said that, I have no need to build my own SMTP client. 
Vibe does a good job. And there is also a more stand-alone 
project on code.dlang.org which I forgot the name of.

> Though I would rather there was no HTML in any email!

 From 
http://www.networkworld.com/article/2199390/uc-voip/the-mime-guys--how-two-internet-gurus-changed-e-mail-forever.html?page=3

```
While Freed was concerned about the problems occurring when 
content moved from one e-mail system to another, "I wanted to be 
able to send pictures and videos and stuff like that in e-mail," 
Borenstein says. "And by the way, when people would ask me, 'Why 
do you care so much about putting media into e-mail?' I always 
said because someday I'm going to have grandchildren and I want 
to get pictures of them by e-mail. And people's reaction was to 
laugh and laugh."

Borenstein started receiving pictures of his twin grandchildren 
via e-mail in 2009
```

That why we want stuff besides text in our emails.


More information about the Digitalmars-d-announce mailing list