Forum Moderators: phranque

Message Too Old, No Replies

convert email data to html

         

SlowMove

7:22 pm on Jan 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I need to batch process email requests to get listed in a directory that I run. I just want to be able to drop all the requests into a folder and loop through them calling a script:

for file
do
#runscript >> outputfile
done

Does anynoe know where I can find a script that needs little modification to convert email data into the html that follows? I don't want to have to reinvent the wheel from scratch if it's already been done.


website_title: Gift Store

website_url: http*://www.url.com/

category: Gifts

description: Cheap Gifts.

name: Gift Seller

email_address: gifts@web*.net

link_url: http*://www.url.com/links.html

redirect: http*://mysite.com/index.html

submit: Submit


gets converted to

<hr />
<h2><a href="http*://www.url.com/" target="_blank">Gift Store</a></h2>
<p>Cheap Gifts.<br>
http*://www.url.com</p>

JasonD

8:11 pm on Jan 11, 2004 (gmt 0)

10+ Year Member



It isn't a small job but far from a major challenge but a few questions first off.

What operating system does your site run on?

Will these emails be sent to a dedicated POP3 or IMAP account?

Presuming a *nix server do you have any experience using procmail?

Presuming a *nix server and no experience with Procmail can you program in Perl or PHP?

The reasons for asking are that all emails that are sent to an email address can be checked for adhering to a set of rules (as you posted above) forwarded to a server side script that will then manipulat the email data to do as you want with them.

The simplest way to forward the email is using Procmail which can then send it to a script (let's presume Perl based) that will parse the emails and build the html you decide.

Once you have answered the above it may be better to ask for further assistance in the relvant programming forum or feel free to sticky me for further advice.

Jason

SlowMove

8:21 pm on Jan 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>Presuming a *nix server do you have any experience using procmail?

No, but I'll check it out. All the data is valid as it's input from a form page. Thanks. That still leaves a lot of work writing and debugging the script.

JasonD

8:23 pm on Jan 11, 2004 (gmt 0)

10+ Year Member



I dont believe an off the shelf solution exists to deliver what you are looking for.