Date:  07/25/2004 07:45:46 AM Msg ID:  002147
From:  Joe Goldsmith Thread:  002143
Subject:  Re: FWX to HTML
Another way I find that works for me is to have a user press a form button to do something and, when captured during page rewrite, put the HTML in a fox variable. You also can add information from a table to customize the output. I use ASPMail so this example may be specifice to ASPEmail.
 
*EXAMPLE*************************
**HTML and FWX INPUT PAGE
**Coding above the HTML tag
<%
IF Request.FormCount("btnchoice") > 0
 * Example of getting form information
 M.userid = RTRIM(Request.Form('userid'))
 * OR, you can put userid in a hidden field
 *m.userid = RTRIM(Request.Form('hidden1'))
 *Get information from table
 IF !USED('mydata')
  USE mydata SHARED IN 0
 ENDIF
 SELECT mydata
 SET EXACT ON
SET DELETED ON
 LOCATE FOR userid = M.USERID
 IF FOUND()
  M.first = firstname
  M.last = lastname
  M.email = email
  m.fullname = ALLTRIM(m.first)+" "+ALLTRIM(m.last)
  isMsg = "<HTML><HEAD><TITLE>My HTML EMAIL</TITLE></HEAD><BODY LEFTMARGIN='0' TOPMARGIN='0'>"
  isMsg = isMsg+"<table border=0 cellspacing=0 cellpadding=0 WIDTH='500' BGCOLOR='0000DD' BORDERCOLOR='0000DD'>"
  isMsg = isMsg+"<tr><td WIDTH='10'><img height=22 src='http://www.mydomain.com/images/leftcurve.gif'>"
  isMsg = isMsg+"</TD><TD ALIGN='LEFT'><IMG SRC='http://www.mydomain.com/images/logoemail.gif'>"
  isMsg = isMsg+"</td><TD WIDTH='10'><img height=22 src='http://www.mydomain.com/images/rightcurve.gif'>"
  isMsg = isMsg+"</TD></tr></TABLE>"
  isMsg = isMsg+"<table border=1 cellspacing='0' cellpadding='5' WIDTH='500' BORDERCOLOR='0000DD' BGCOLOR='#D2E5F3'>"
  isMsg = isMsg+"<tr ALIGN='LEFT' VALIGN='TOP'><td valign=top>"
  isMsg = isMsg+"Dear "+(m.name)+"<BR>"
  isMsg = isMsg+"Your text or text from another field or memo field"+"<BR>"
  isMsg = isMsg+"</TD></TR></TABLE></BODY></HTML>"
 
  Mail = CreateObject("Persits.MailSender")
  Mail.Host = "your email domain address"
  Mail.From = "your email address"
  Mail.FromName = "your name"
 
  Mail.AddAddress (M.email)
  Mail.Subject = "your subject"
  Mail.IsHTML = .T.
  Mail.Priority = 1
  Mail.Queue = .T.
  Mail.Body = (isMsg)
  Mail.Send
  RELEASE mail
  USE
  Response.Redirect("send user to another web page")
 ENDIF
ENDIF
%>
* The rest of the page with a form.
HTML (and so on)
**************************

Joe