For Programmers: Free Programming Magazines  


Home > Archive > PHP Programming > December 2004 > Mail attachment questions...









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Mail attachment questions...
knoak

2004-12-29, 8:55 am

Hi Pedro,

I know i have to read a lot. :) But sometimes
i need a little help from my friends, because i
am the only one in my environment that experiments
with php who could help me.. :(

Few questions though:

I cannot imagine that sending html is too much
for automated mail, or shouldn't i take this
too literally?

Would it be better to send a mail with an image in it
with an absolute url instead of attachment? Then renaming
files is not-done anymore, but it keeps the mail small...
Well thanks anyway!!

greetings
Manuel Lemos

2004-12-29, 8:55 pm

Hello,

on 12/29/2004 08:58 AM knoak said the following:
> I cannot imagine that sending html is too much
> for automated mail, or shouldn't i take this
> too literally?


You should not send HTML only messages, as your messages may be blocked
for seeming like SPAM.

What you need to do is to compose a multipart/alternative message that
includes both an HTML part and an alternative plain text part.


> Would it be better to send a mail with an image in it
> with an absolute url instead of attachment? Then renaming
> files is not-done anymore, but it keeps the mail small...
> Well thanks anyway!!


It depends on the importance of the images for your messages. Most
modern webmail and e-mail clients tend to not show remote images in the
messages as it may be a beacon to invade the user privacy to determine
when the message was received.

You can include images within the message body that are treated as part
of the HTML message using multipart/related message parts.

This is a little complicated but fortunately there are ready to use
classes to help you compose and send proper HTML messages, like for
instance this MIME message class:

http://www.phpclasses.org/mimemessage


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Manuel Lemos

2004-12-29, 8:55 pm

Hello,

on 12/29/2004 08:58 AM knoak said the following:
> I cannot imagine that sending html is too much
> for automated mail, or shouldn't i take this
> too literally?


You should not send HTML only messages, as your messages may be blocked
for seeming like SPAM.

What you need to do is to compose a multipart/alternative message that
includes both an HTML part and an alternative plain text part.


> Would it be better to send a mail with an image in it
> with an absolute url instead of attachment? Then renaming
> files is not-done anymore, but it keeps the mail small...
> Well thanks anyway!!


It depends on the importance of the images for your messages. Most
modern webmail and e-mail clients tend to not show remote images in the
messages as it may be a beacon to invade the user privacy to determine
when the message was received.

You can include images within the message body that are treated as part
of the HTML message using multipart/related message parts.

This is a little complicated but fortunately there are ready to use
classes to help you compose and send proper HTML messages, like for
instance this MIME message class:

http://www.phpclasses.org/mimemessage


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com