473,397 Members | 2,084 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Webpage to email

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
Jul 17 '05 #1
3 1506
lig
have you tried parsing or regex to find the relative urls and convert
them?

Jul 17 '05 #2
Yes,
find and replace....even the wordpad has that.
Bye

Jul 17 '05 #3
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

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Nancy | last post by:
Hi, Guys, Is there any other way to use python or mod_python writing a web page? I mean, not use "form.py/email", no SMTP server. <form action="form.py/email" method="POST"> ... Thanks a lot. ...
22
by: Ruslan Kogan | last post by:
Hi, I have a webpage with a table that has 4 cells (2x2). In one of those cells, I wish to load a webpage stored on a different server (say...www.webpage.com/abc.htm). Does HTML allow for this...
5
by: sifar | last post by:
Hi, This is my first post to this Group. A] I am trying to create a escalation page which will mail an escalation report of a faulty product. Items needed on Page: -----------------------
6
by: Chris | last post by:
I have been learning C and want to write a program and need someone to point me in the write direction. I want to write a program to store all my webpage bookmarks in possibly one file. I want it...
3
by: GraVity via DotNetMonster.com | last post by:
Hello all I am new to asp.net or web programming I have a requirement, I have to submit a document to another server using my webpage, there is a perticular protocol for doing that. This protocol...
3
by: batista | last post by:
Hello all, I currently have a webpage which has a grid and using webservice.htc im updating its content after every 5 seconds. Now I want to add two forms at the bottom of the page.One of them...
6
by: shivavrata | last post by:
Hi All, I want to transfer the data form webpage to any other own application which is running in backend.How i develop this web page. which technology is good for this or any particular protocol...
1
by: Rajen | last post by:
I've a automatic configuration proxy (http://xxx.xxx.xxx.xxx/xyz.pac) which I use in the Internet explorer Lan Settings to access the net. How do I read a webpage by specifying this proxy in my...
4
by: eschneider | last post by:
I get the following error when trying to browse the .asmx. I get the same thing when trying to add a reference. using .NET 2.0 There is no error message. Any ideas? Thanks,
15
by: Peter | last post by:
I have the following web page and I am trying to have the Field lables NOT to wrap. It looks fine in a designer but when I run the program in a browser the lables that have a space wrap. How do I...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.