>> Questions about Flow: XML -> Send to Friend

Gene Ellis

Usenet Archive
Joined
Jan 23, 2003
Messages
7
Reaction score
0
Hey everyone,

I have a simple task. I want to take an XML file, pull out the elements in it, format them, and then send an html email based on it. What are the necessary steps? Any suggestions? I know how to write XSL style sheets. Most of my confusion lays in how to get the XML elements for matted and the transformed in such a form that is email-able.
Thank you so much!
 

Andrzej Adam Filip

Usenet Archive
Joined
Mar 3, 2004
Messages
44
Reaction score
0
Gene said:
Hey everyone,

I have a simple task. I want to take an XML file, pull out the elements in it, format them, and then send an html email based on it. What are the necessary steps? Any suggestions? I know how to write XSL style sheets. Most of my confusion lays in how to get the XML elements for matted and the transformed in such a form that is email-able.
Thank you so much!

If you use unix/linux:
* Use xslt to convert the xml file to "hmtl file" (xml -> html) and "email headers file" (xml -> plain text). You can use two xsl files or xslt processor capable to produce more than one output file.
* Use the command below to send the files
( cat msg.hdr; echo ; cat msg.html) | sendmail -oi -t

-t - will make sendmail (or MTA pretending to be sendmail) to get recipient addresses from headers

Recomended headers in msg.hdr:
subject,from,to (OR cc OR bcc),
Content-Type (text/html),Content-Transfer-Encoding (8bit),MIME-Version (1.0).
 

Malcolm Dew-Jones

Usenet Archive
Joined
Jan 24, 2002
Messages
347
Reaction score
0
Gene Ellis wrote:
: Hey everyone,

I have a simple task. I want to take an XML file, pull out the elements in it, format them, and then send an html email based on it. What are the necessary steps? Any suggestions? I know how to write XSL style sheets. Most of my confusion lays in how to get the XML elements for matted and the transformed in such a form that is email-able.
Thank you so much!

This is a two step job.

First step is to create the text/plain and-or text/html sections. Ignore all issues of mail formatting at this stage. This is a standard xml/xsl process. Create the data as xml. Use xlst to pull out the things you want and format them the way they should eventually be seen. Save the result in one or more files (one file per format, e.g. if the mail should have a text/plain section and a text/html section then format then there will be two files produced).

Second step is to pack the files into a mail message. You could probably use a stylesheet for that, but why bother? Use a mail or mime tool to bundle the parts together. I have used perl MIME::Lite, but there are numerous other tools available.
 

GIMME

Usenet Archive
Joined
Jun 3, 2003
Messages
107
Reaction score
0
What operating system are you on and what tools are you wanting to use?

Why can't you do a transform and send a message formated in html (xhtml)?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,042
Messages
3,104,224
Members
248,132
Latest member
henrywalsh

Latest Threads

Top