Advertisement

04.22.2008 at 06:45AM PDT, ID: 23342879
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.3

CDONTS HTML EMAIL FORMAT

Asked by Platini in Active Server Pages (ASP)

Tags: , ,

I have a asp form that someone would complete and when submitted, email is sent with all answers to the questions. If you look at the wizard_proc.asp, there is already html formatted message that is being send back once the user completes the form. What I need is the html formatted message that would be formatted the same way like the form user completes.

this is the form user completes:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
 
<head>
 
 
 
<title>Untitled Document</title>
 
 
 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
 
 
<style type="text/css">
 
<!--
 
.style2 {
      font: 12px;
      font-size: x-small;
      font-family: Verdana;
}
 
.style3 {font-family: Verdana, Arial, Helvetica, sans-serif}
 
th
      { color: #000000; font-family: Tahoma, Verdana; font-size: 11px; }
.newStyle1 {
      font-family: Verdana;
      font-size: 12px;
      background-color: #0099CC;
}
.newStyle2 {
      color: #D9ECFF;
      background-color: #FFFFFF;
}
 
.style4 {
      font-size: small;
      font-family: Verdana, Arial, Helvetica, sans-serif;
}
.newStyle1Copy {
      font-family: Verdana;
      font-size: 12px;
      background-color: #CAE4FF;
}
 
-->
 
</style>
 
 
 
<script type="text/javascript">
<!--
/*********************************************************************
                         Original Script By
               Patrick Fairfield (a.k.a fritz_the_blank)
                         Fairfield Consulting
     ========================================================
                         Edited by Jay Solomon
                    jaysolomon *AT* pclnet *DOT* net
*********************************************************************/
var strAlertMsg = ""
var focusField = ""
//============================================================
//validate Date
function isDate(theForm,strFieldName,strMsg){
    var objFormField = theForm.elements[strFieldName];
    strDate = objFormField.value;
    if(strDate.length>0){
            var dateregex=/^[ ]*[0]?(\d{1,2})\/(\d{1,2})\/(\d{4,})[ ]*$/;
             var match=strDate.match(dateregex);
             if (match){
                       var tmpdate=new Date(match[3],parseInt(match[1],10)-1,match[2]);
                  if (tmpdate.getDate()==parseInt(match[2],10) && tmpdate.getFullYear()==parseInt(match[3],10) && (tmpdate.getMonth()+1)==parseInt(match[1],10)){
                    return true;
                    }
             }
                    strAlertMsg += "- "+ strMsg +" is Required.\nExample: 01/01/2003\n";
               if(!focusField) focusField =""+ strFieldName +"";
         return false;
    }
    else{
          return true;
    }
}
//========================================================================
//Validate Us Phone. Ex. (999) 999-9999 or (999)999-9999
function isPhone(theForm,strFieldName,strMsg)     {
     var objFormField = theForm.elements[strFieldName];
     var strValue = objFormField.value;
     var objRegExp  = /^\([1-9]\d{2}\)\s?\d{3}\-\d{4}$/;
      if(!objRegExp.test(strValue)){
          strAlertMsg += "- "+ strMsg +" is Required.\n    Example:\n(999)999-9999 or (999) 999-9999\n";
     if(!focusField) focusField=""+ strFieldName +"";
          return false;
          }
     return true;
}
//========================================================================
//Validate US zip code in 5 digit format or zip+4 format. 99999 or 99999-9999
function isZipCode(theForm,strFieldName,strMsg)     {
     var objFormField = theForm.elements[strFieldName];
     var strValue = objFormField.value;
     var objRegExp  = /(^\d{5}$)|(^\d{5}-\d{4}$)/;
     if(!objRegExp.test(strValue)){
          strAlertMsg += "- "+ strMsg +" is Required.\n";
     if(!focusField) focusField =""+ strFieldName +"";
          return false;
          }
     return true;
}
//==========================================================================
//Validate the Select
function hasSelection(theForm,strFieldName,strMsg)     {
     var objFormField = theForm.elements[strFieldName];
     if(objFormField.selectedIndex ==0)     {
          strAlertMsg += "- "+ strMsg +" is Required.\n";
           return false;
           }
     return true;
}
//========================================================================
//Validate Check Box
function isChecked(theForm,strFieldName,strMsg) {
     var objFormField= theForm.elements[strFieldName];
     var strValue= objFormField.checked;
     if (!strValue) {
          //alert("The \""+ strMsg +"\" box is checked!")
          //} else {
          strAlertMsg += "- "+ strMsg +" is Required.\n";
     if(!focusField) focusField =""+ strFieldName +"";
          return false;
          }
     return true;
}
//========================================================================
//Validate Text Box
function isEmpty(theForm,strFieldName,strMsg){
     var objFormField = theForm.elements[strFieldName];
     var strValue = objFormField.value;
     strValue = strValue.split(" ").join("")
     if(strValue.length<1){
          strAlertMsg += "- "+ strMsg +" is Required.\n";
     if(!focusField) focusField =""+ strFieldName +"";
          return false;
          }
     return true;
}
//========================================================================
//Validate Email
function isEmail(theForm,strFieldName,strMsg){
     var objFormField = theForm.elements[strFieldName]
     var strEmail = objFormField.value;
     var bolValid = true;
          if(strEmail.length < 7){
          bolValid = false;
          }
          if(strEmail.lastIndexOf(" ") >0){
          bolValid = false;
          }
          var intLastDot = strEmail.lastIndexOf(".")
          if(intLastDot == -1 ||  strEmail.length - intLastDot >4){
          bolValid = false;
          }
          var intAt = strEmail.lastIndexOf("@")
          if(intAt == -1 ||  strEmail.length - intAt < 5){
          bolValid = false;
          }
          if(!bolValid){
          strAlertMsg += "- "+ strMsg +" is Required.\n";
     if(!focusField) focusField =""+ strFieldName +"";
          }
     return bolValid;
}
//========================================================================
//Validate Radio Button
function checkRadioControl(theForm,strFieldName,strMsg){
          var objFormField = theForm.elements[strFieldName]
          intControlLength = objFormField.length
          bolSelected = false;
          for (i=0;i<intControlLength;i++){
          if(objFormField[i].checked){
          objFormField[0].style.backgroundColor = "white";
          bolSelected = true;
          break;
          }
     }
     if(! bolSelected){
           if(!focusField) focusField =""+ objFormField[0].id +"";
          strAlertMsg += "- "+ strMsg +" is Required.\n";
          objFormField[0].style.backgroundColor = "yellow";
          return false;
          }
         
     return true;
}
//========================================================================
//Compare the Fields
function compareFields(theForm,strFieldName1,strFieldName2,strMsg){
          var objFormField1= theForm.elements[strFieldName1];
          var objFormField2= theForm.elements[strFieldName2];
          var strValue1= objFormField1.value;
          var strValue2= objFormField2.value;
     if(strValue1 != strValue2){
          strAlertMsg +="The "+ strMsg +" fields do not match, please try again.\n";
     if(!focusField) focusField =""+ strFieldName1 +"";
          return false;
          }
     return true;
}
//========================================================================
//Format Phone Number 9999999999 = (999)999-9999
//Call the function like so onKeyPress="javascript:formatPhone(this);
function formatPhone(objFormField){
     intFieldLength = objFormField.value.length;
     if(intFieldLength == 3){
          objFormField.value = "(" + objFormField.value + ") ";
          return false;
          }
    if(intFieldLength >= 9 && intFieldLength <= 10){
        objFormField.value = objFormField.value + "-";
        return false;
        }
}
//========================================================================
//End .js File
//Begin Page Validation
function validateForm(theForm){
strAlertMsg = ""
focusField = ""
     
     isEmpty(theForm,'Customer_Name','Name')
     isEmpty(theForm,'email','Email')
     isEmpty(theForm,'dDate','Date')
     checkRadioControl(theForm,'radio1','Radio')
     checkRadioControl(theForm,'radio2','Radio')
       isEmpty(theForm,'PhoneB','textbox')
     checkRadioControl(theForm,'radio3','Radio')
       checkRadioControl(theForm,'radio4','Radio')
     checkRadioControl(theForm,'radio5','Radio')
     checkRadioControl(theForm,'radio6','Radio')
     checkRadioControl(theForm,'radio7','Radio')
     checkRadioControl(theForm,'radio8','Radio')
     checkRadioControl(theForm,'radio9','Radio')
         if(strAlertMsg !=""){
          alert("Please correct the following errors:\n____________________________\n\n" + strAlertMsg);
          eval("theForm." + focusField + ".focus()");
//alert(focusField);
theForm[focusField].focus();

        return false;
    }
    return true;
}
//-->
</script>

 
 
 
 
 
 
</head>
 
<body class="sub">
 
 
 
<form id="form1" action="/508/wizard_proc.asp" method="post" onsubmit="return validateForm(this);">
 
 
 
 
   
 
  <table border="0" cellspacing="2" cellpadding="4" style="width: 800">
 
   
 
    <tr style="vertical-align: top">
 
     
 
      <td valign="top" nowrap="nowrap" style="width: 722px; height: 31px;">
 
        <table cellSpacing="0" cellPadding="0" align="left" border="0" style="width: 713px">
                  <tr>
                        <th style="FONT-SIZE: 12px; COLOR: white" noWrap bgColor="#4682b4">  
                        &nbsp;Visual Impairment Form<img height="1" src="pixel.gif" width="10" border="0" /></th>
                        <td>
                        <img height="21" src="formtab_r.gif" width="10" border="0" /></td>
                        <td width="100%" background="line_t.gif" class="newStyle1"> </td>
                  </tr>
            </table>
            </td>
 
    </tr>
 
   
 
    <tr style="vertical-align: top">
 
     
 
      <td valign="top" nowrap="nowrap" style="width: 722px">
 
        <p class="style2">
 
          <span class="style2">
 
          <label id="lblCustome_Name" for="Customer_Name" class="style2">Name</label></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                                          
 
          <input type="text" id="Customer_Name" name="Customer_Name" class="newStyle1Copy" tabindex="0" />
                  <br />
<br />
          <label id="lblemail" for="email" class="style2">Please enter your email address</label>&nbsp;&nbsp;      
 
          <input type="text" name="email" id="email" class="newStyle1Copy" tabindex="0" />
                  <br />
<br />      
 
          <label id="lbldDate" for="dDate" class="style2">Please enter today&#39;s date</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;              
 
          <input type="text" name="dDate" id="dDate" class="newStyle1Copy" tabindex="0" /><br />
&nbsp;<FIELDSET class="style2">
          <LEGEND class="style2"> Do you need a screen reader to
                  access your computer?</LEGEND>
         
 
            <input type="radio" name="radio1" value="Yes" id="radio1y" class="style2" tabindex="0" /><span class="style2">Yes
 
         
 
          </span>
 
         
 
          <label><input type="radio" name="radio1" value="No" id="radio1n" class="style2" /><span class="style2">No</span></label>
 
         </FIELDSET><span class="style2"> </span>
        <p class="style2">
 
         
 
       
 <FIELDSET style="height: 38px">

        <legend class="style2">Do you need to hear your screen reader
            while on the phone?</legend>
 
         
             
          <input type="radio" name="radio2" value="Yes" id="radio2y" class="style2" tabindex="0" /><span class="style2">Yes
 
         
          </span>
 
         
          <input type="radio" name="radio2" value="No" id="radio2n" class="style2" /><span class="style2">No
 
        </span>
 
        <br /></FIELDSET><span class="style2"><br />
      </span>
<FIELDSET>
          <legend class="style2">What brand and model of phone do you
                  use?</legend>


 
          <textarea name="PhoneB" id="PhoneB" rows="5" class="newStyle1Copy" style="width: 373px" tabindex="0"></textarea>
 </FIELDSET>
         
 
        <p class="style2">
 
         
 
          <span class="style3">
 
 <FIELDSET class="style2">        
 <legend>Do you need a braille display for reading information on your
                  computer?</legend>
 
         
 
         
                  <input type="radio" name="radio3" value="Yes" id="radio3y" tabindex="0" />Yes
 
 
         
 
          <input type="radio" name="radio3" value="No" id="radio3n" tabindex="0" />No
 </FIELDSET>
          </span></p>
 
      <p class="style4">
 
        <FIELDSET>
        <legend class="style2">Do you prefer a 40 or 80 cell braille display?</legend>
 
       
 
       
            <input type="radio" name="radio4" value="40 cell" id="radio4y" class="style2" tabindex="0" /><span class="style2">40 cell
 
         
        </span>
 
         
        <input type="radio" name="radio4" value="80 cell" id="radio4n" class="style2" tabindex="0" /><span class="style2">80 cell</span></label><span class="style2">
            </span>
 </FIELDSET>
      </p>
 <fieldset>
      <span class="style3">
 
        <legend class="style2">Do you need to access printed materials to complete your daily
            assignments?</legend>
 
       
 
        <label id="lblFname" for="radio5">
            <input type="radio" name="radio5" value="Yes" id="radio5y" class="style2" /></label></span><label id="Label1" for="radio5"><span class="style2">Yes</span></label><span class="style3">
 
        <label>
 
        <input name="radio5" type="radio" id="radio5n" value="No" class="style2" /></label></span><label><span class="style2">No</span></label><span class="style3">
 
      </span></fieldset>
 
      <p class="style2"><span class="style3">
 <fieldset class="style2">
        <legend>Do you need to produce hardcopy braille materials in your daily
            work activities?</legend>
 
       
 
        <label id="Label2" for="radio6"><input type="radio" name="radio6" value="Yes" id="radio6y" />Yes</label>
 
        <label>
 
        <input type="radio" name="radio6" value="No" id="radio6n" />No</label></fieldset>
 
      </span></p>
 
      <p class="style2"><span class="style3">
 
        <fieldset class="style2">
        <legend>Do you have access to a shared braille embosser (printer)?</legend>
       
 
        <label id="Label3" for="radio7"><input type="radio" name="radio7" value="Yes" id="radio7y" />Yes
 
       
 
        <input type="radio" name="radio7" value="No" id="radio7n" />No</fieldset>
      </span></p>
 
      <p class="style2"><span class="style3">
             <fieldset class="style2">
        <legend>Do you have issues locating keys on your keyboard?</legend>
 
       
 
<label id="Label4" for="radio8"><input type="radio" name="radio8" value="Yes" id="radio8y" />Yes</label>
 
         
        <input type="radio" name="radio8" value="No" id="radio8n" />No</fieldset>
 
      </span></p>
 
      <p class="StoryContentColor style2 style3"><span class="style2">
 
        <fieldset class="style2">
        <legend>Do you need to take notes during meetings away from your desk
            and/or in training sessions?</legend>
 
       
 
        <input type="radio" name="radio9" value="Yes" id="radio9y" />Yes
 
         
        <input type="radio" name="radio9" value="No" id="radio9n" />No</fieldset>
      </span></p></td>
 
    </tr>
 
   
 
    <tr style="vertical-align: top">
 
      <td style="width: 722px">        
 
     <input type="submit" id="btnSubmit" name="btnSubmit" value="Submit" />
 
     <input type="reset" id="btnReset" name="btnReset" value="Reset" />
 
            </td>
 
    </tr>
 
  </table>
 
 
 
  </form>
 
 
 
 
</body>
 
</html>
 
Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
wizard_proc.asp
<%response.buffer = true%>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>
 
<body>
<%
On Error resume next
 
Dim MailBody
Dim MyMail
 
	MailBody = "<html><table><tr><td><b>Name:</b></td><td>"&request("Customer_Name")&"</td><br>" &_
				"<b>Phone No.: </b>"&request("email")&_
				"<tr><td><b>Email:</b></td><td>"&request("dDate")&"</td><td><b>Business Unit:</b></td><td>"&request("Organization")&"</td></tr>" &_
				"<tr><td><b>Information Looking for:</b> </td><td>"&request("radio1")&"</td>" &_
				"<td><b>Project:</b></td><td>"&request("radio2")&"</td></tr>"&_
				"<tr><td><b>Requisition Number</b></td><td>"&request("PhoneB")&"</td></tr>"&_
				"<tr><td><b>Question:</b></td>" &_
				"<td><textarea rows='10' cols='40'>"&request("radio3")&"</textarea></td></tr></table></html>"
				
	MailSubject="Request for 508 assistance"
	
	strRedirect = "/Detail508FAQ.asp?id=1"
 
	Set MyMail = Server.CreateObject("CDONTS.NewMail")
	MyMail.from = "info@info.com"
	MyMail.To = "info@info.com"
	MyMail.MailFormat = 0	'0=Mime format, 1=default plain text format
	MyMail.BodyFormat = 0	'0=HTML format, 1=default plain text format
	MyMail.Subject = MailSubject	
	MyMail.Body = MailBody
	MyMail.Send
	Set MyMail = Nothing
	
	If err.Number = 0 then
		Response.redirect strRedirect
	Else
		Response.write "Error occured when sending your order.  Please try again later.  If problem persist, please contact the webmaster at <a href='mailto:*Irap' class='footanchor'>*Irap</a>. <BR>"
		Response.write "Err #:" & err.number & "<BR>"
		response.write "Error Description:  " & Err.Description
	End If
		
%>
</body>
 
</html>
[+][-]04.22.2008 at 07:05AM PDT, ID: 21411194

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.22.2008 at 07:30AM PDT, ID: 21411451

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.22.2008 at 03:07PM PDT, ID: 21416021

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.22.2008 at 07:10PM PDT, ID: 21417263

View this solution now by starting your 14-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Active Server Pages (ASP)
Tags: asp, IE, CDONTS HTML format
Sign Up Now!
Solution Provided By: tanwaising
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20081112-EE-VQP-43 / EE_QW_2_20070628