Apparently I wasn't clear in my first question-- I wanted a way to have PHP
transform an arbitrary url into a document that could be sent by email. A
simple regex wouldn't work-- it would need to be smart enough to find all
relative references (e.g. href=,src=,background=, etc) and recognize that
things that might look like references but aren't in tags should be left
alone (e.g., content, javascript variables, etc.)
I did find a solution: Inject an appropriate BASE URI into the document
<head> if one does not already exist.
Thanks for the replies though,
Kevin
"Kevin" <ke***@wxREMOVE4SPAM3.com> wrote in message
news:zOHwd.587886$D%.451850@attbi_s51...
Several times recently I've been asked to generate HTML email messages for
clients. It would be very nice to be able to render an existing webpage
in such a way that it could be included as the HTML portion of an email
message.
The problem is that web pages usually have some relative urls, such as for
images, links, stylesheets, backgrounds, etc. which wouldn't work in an
email.
Does anyone know of a way (in PHP) to translate all the relative urls in a
document to absolute?
Thanks,
Kevin