Month: March 2016

How to send an email with image files and the the images are shown on page instead of being attachments ?

Your email must satisfy the following rules: 1. it’s a multi-part email 2. it has an "html" as one of its parts (content type must be set) 3. every image must have a header like "Content-ID: <some-id>", and of course, content type must be set 4. the <img> tags in your html must use "cid" …

How to send an email with image files and the the images are shown on page instead of being attachments ? Read More »

man.get_things() or Thing.get_things_by_man() when Active Records Pattern is used?

There is requirement for a method to get things of a man.  Where to put it?   man.get_things() or   (static) Thing.get_things_by_man()  ?   From OO’s perspective, the former sounds more natural.   I was planning to adopt this approach until I found a problem:  it may lead to duplicate db access code because not …

man.get_things() or Thing.get_things_by_man() when Active Records Pattern is used? Read More »