Home > Archive > PHP Smarty Templates > January 2005 > sending emails using my smarty templates
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 |
sending emails using my smarty templates
|
|
| Abdul-Wahid Paterson 2005-01-15, 3:59 am |
| Hi,
I have a number of webpages that I would like to have an "email to
friend" link that sends the page as an HTML email. I was thining of a
solution that would use the "register_outputfilter" method to parse
the template and to extract href urls and image urls. To change the
href URLs so that they are fully qualified and to change the images so
that I can load them through the Pear MIME::Mail class as a in-line
attached image.
Would this in theory be possible? Has anyone else a better way of
doing it or other suggestions?
Regards,
Abdul-Wahid
| |
| Manuel Lemos 2005-01-16, 3:58 am |
| Hello,
on 01/14/2005 04:36 PM Abdul-Wahid Paterson said the following:
> Would this in theory be possible? Has anyone else a better way of
> doing it or other suggestions?
Extracting the images to send them in HTML e-mail messages it is not
trivial. It is probably simpler to prepend an HTML <BASE> tag to specify
the base URL and let the receiving mail client resolve the images URL
automatically.
Anyway, to send HTML e-mail from Smarty templates it is not hard.
However, if you want to prevent having your messages being trapped by
spam filters, you should not send HTML only messages. All text messages
must have an alternative text part or else some systems like for
instance Hotmail may discard your message.
Here you may find an example of how to compose and send HTML messages
with alternative text parts using Smarty templates to generate the
HTML part and the text alternative part:
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
|
|
|
|
|