NYCPHP Meetup

NYPHP.org

[nycphp-talk] fsockopen / scrape / html mail

Jerry Kapron jkapron at NewAgeWeb.com
Sat Jan 11 00:37:00 EST 2003


>>On Fri, 10 Jan 2003, Lynn, Michael  wrote:
>> Is anyone aware of how to scrape and grab content and mail it so that the
email is wholey contained and independent of the original url/server?
...

>On Fri, 10 Jan 2003, Andrew M. Yochum wrote:
>I'm not sure how you would include the images as attachments for use in
HTML in
>the email.
...

Michael/Andrew,
It's possible to create a self-contained HTML e-mail message with images.
I've done this many times.  You need to compile a multipart/related MIME
document. The images have to be base64 encoded, each as a separate MIME
content part.
In multipart/related MIME messages each part has it's own unique id
specified in the part's MIME headers:
Content-ID: <part1.message.id at not_important.com>

Those id's would be used instead of image URI's in the HTML part of the
message:
<IMG mailto:SRC="cid:part1.message.id at not_important.com>

It's also a good idea to include this header for each part that should be
'embedded' rater than treated as an attachment:
Content-Disposition: inline; filename="image.jpeg"

... and of course:
Content-Type: image/jpeg
Content-Transfer-Encoding: base64

You should find more info in this rfc doc:
http://www.faqs.org/rfcs/rfc1872.html

Good luck,
Jerry




More information about the talk mailing list