|
Valaire -> Random Outputting Error in E-mail (8/23/2002 22:48:33)
|
I' m having a problem, and to make matters worse, the output seems to be randomized so I am having a hard time pinpointing the cause. I have an ASP page that opens up a database connection and retrieves a recordset and sends information about that recordset in a CDONTS e-mail. Said e-mail is HTML formatted and has different color schemes. When I test the e-mail, sometimes there are unexplained output problems. I' ve never gotten the e-mail to look bug-free, it' s always got something wrong. Sometimes it outputs part of the asp code, sometimes a font bleeds where it shouldn' t, sometimes a line break doesn' t insert itself. I' ve had about 3-4 different bug ' states' , and it seems to change based on time. The code itself is all uniform. I' m thinking it has to do with the html of the CDONTS... I' m having the problem on 3 clients all using Outlook. Here is the entire code for the page: <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" >
<title>APXOnline Inquiry Database - E-mail Confirmation</title>
</head>
<body bgcolor=" #00CC99" >
<%
Dim SendToEmail, SendFromName, SendToName, Notes, ID, objConn, objRS, strSQL, CDONTSMail, Msg
ID = Session(" EmailID" )
Set objConn = Server.CreateObject(" ADODB.Connection" )
objConn = Application(" Inquiry_ConnectionString" )
Set objRS = Server.CreateObject(" ADODB.Recordset" )
strSQL = " SELECT * FROM External WHERE ID = " & ID
objRS.Open strSQL, objConn
SendToEmail = Request.Form(" RecipientEmail" )
SendFromName = Request.Form(" SenderName" )
SendToName = Request.Form(" RecipientName" )
Notes = Request.Form(" Notes" )
Set CDONTSMail = CreateObject(" CDONTS.NewMail" )
CDONTSMail.From = " apx@apxonline.com"
CDONTSMail.To = SendToEmail
CDONTSMail.Subject = " APXOnline Inquiry"
Msg = " <HTML><HEAD><TITLE>APXOnline Inquiry</TITLE></HEAD><BODY>"
Msg = Msg & " An APXOnline Inquiry has been forwarded to you by " & SendFromName & " at APX Technologies, Inc. The following notes have been included by the sender:<br><br>"
Msg = Msg & " <I>" & Notes & " </I><br><br><hr><font size=6>" & Request.Form(" Form" ) & " APXOnline Inquiry -- " & objRS(" Timestamp" ) & " </font><br><br>"
Msg = Msg & " <B><Font Color=Purple>Company:</Font> <Font Color=DarkOrchid></B>" & objRS(" Company" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=Purple>Address 1:</Font> <Font Color=DarkOrchid></B>" & objRS(" Address" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=Purple>Address 2:</Font> <Font Color=DarkOrchid></B>" & objRS(" City" ) & " , " & objRS(" State" ) & " " & objRS(" Zip" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=Purple>Country:</Font> <Font Color=DarkOrchid></B>" & objRS(" Country" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=Purple>Name:</Font> <Font Color=DarkOrchid></B>" & objRS(" Name" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=Purple>Title:</Font> <Font Color=DarkOrchid></B>" & objRS(" Title" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=Purple>Phone:</Font> <Font Color=DarkOrchid></B>" & objRS(" Phone" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=Purple>Fax:</Font> <Font Color=DarkOrchid></B>" & objRS(" Fax" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=Purple>E-mail:</Font> <Font Color=DarkOrchid></B>" & objRS(" Email" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=Purple>Contact:</Font> <Font Color=DarkOrchid></B>" & objRS(" Contact" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=Purple>Product:</Font> <Font Color=DarkOrchid></B>" & objRS(" New or Existing" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=Purple>Needed:</Font> <Font Color=DarkOrchid></B>" & objRS(" When Needed" ) & " </Font><BR><BR>"
Msg = Msg & " <B><Font Color=DarkBlue>Primary Input Voltage:</Font> <Font Color=CornflowerBlue></B>" & objRS(" P1 Input Volt" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=DarkBlue>Primary Input Frequency:</Font> <Font Color=CornflowerBlue></B>" & objRS(" P1 Input Freq" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=DarkBlue>Universal Minimum Voltage:</Font> <Font Color=CornflowerBlue></B>" & objRS(" P2 Min Volt" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=DarkBlue>Universal Maximum Voltage:</Font> <Font Color=CornflowerBlue></B>" & objRS(" P2 Max Volt" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=DarkBlue>Class:</Font> <Font Color=CornflowerBlue></B>" & objRS(" Class" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=DarkBlue>1st Output Voltage:</Font> <Font Color=CornflowerBlue></B>" & objRS(" S1 Output Volt" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=DarkBlue>1st Output Current:</Font> <Font Color=CornflowerBlue></B>" & objRS(" S1 Output Current" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=DarkBlue>1st Minimum Load:</Font> <Font Color=CornflowerBlue></B>" & objRS(" S1 Min Load" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=DarkBlue>2nd Output Voltage:</Font> <Font Color=CornflowerBlue></B>" & objRS(" S2 Output Volt" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=DarkBlue>2nd Output Current:</Font> <Font Color=CornflowerBlue></B>" & objRS(" S2 Output Current" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=DarkBlue>2nd Minimum Load:</Font> <Font Color=CornflowerBlue></B>" & objRS(" S2 Min Load" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=DarkBlue>3rd Output Voltage:</Font> <Font Color=CornflowerBlue></B>" & objRS(" S3 Output Volt" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=DarkBlue>3rd Output Current:</Font> <Font Color=CornflowerBlue></B>" & objRS(" S3 Output Current" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=DarkBlue>3rd Minimum Load:</Font> <Font Color=CornflowerBlue></B>" & objRS(" S3 Min Load" ) & " <BR>"
Msg = Msg & " <B><Font Color=DarkBlue>4th Output Voltage:</Font> <Font Color=CornflowerBlue></B>" & objRS(" S4 Output Volt" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=DarkBlue>4th Output Current:</Font> <Font Color=CornflowerBlue></B>" & objRS(" S4 Output Current" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=DarkBlue>4th Minimum Load:</Font> <Font Color=CornflowerBlue></B>" & objRS(" S4 Min Load" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=DarkBlue>Ripple Max:</Font> <Font Color=CornflowerBlue></B>" & objRS(" Ripple Max" ) & " <BR>"
Msg = Msg & " <B><Font Color=DarkBlue>Percentage Overall:</Font> <Font Color=CornflowerBlue></B>" & objRS(" Overall" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=DarkBlue>Noise:</Font> <Font Color=CornflowerBlue></B>" & objRS(" VPP" ) & " <BR>"
Msg = Msg & " <B><Font Color=DarkBlue>Configuration:</Font> <Font Color=CornflowerBlue></B>" & objRS(" Configuration" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=DarkBlue>Length:</Font> <Font Color=CornflowerBlue></B>" & objRS(" Length" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=DarkBlue>Width:</Font> <Font Color=CornflowerBlue></B>" & objRS(" Width" ) & " v<BR>"
Msg = Msg & " <B><Font Color=DarkBlue>Height:</Font> <Font Color=CornflowerBlue></B>" & objRS(" Height" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=DarkBlue>Unit:</Font> <Font Color=CornflowerBlue></B>" & objRS(" Unit" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=DarkBlue>Output Connector Type:</Font> <Font Color=CornflowerBlue></B>" & objRS(" Output Connector Type" ) & " </Font><BR><BR>"
Msg = Msg & " <B><Font Color=Crimson>Application:</Font> </B>" & " <Font Color=Red>" & objRS(" Application" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=Crimson>Quantity:</Font> <Font Color=Red></B>" & objRS(" Quantity" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=Crimson>Environmental Conditions:</Font> <Font Color=Red></B>" & objRS(" Environmental Conditions" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=Crimson>Safety Agency Requirements:</Font> <Font Color=Red></B>" & objRS(" Safety Agency Reqs" ) & " </Font><BR>"
Msg = Msg & " <B><Font Color=Crimson>Notes:</Font> <Font Color=Red></B>" & objRS(" Notes" ) & " </Font><BR>"
Msg = Msg & " </BODY></HTML>"
CDONTSMail.Body = Msg
CDONTSMail.BodyFormat = 0
CDONTSMail.MailFormat = 0
CDONTSMail.Send
Set CDONTSMail = Nothing
%>
<p align=" center" > </p>
<p align=" center" > </p>
<p align=" center" > </p>
<p align=" center" > </p>
<p align=" center" > </p>
<p align=" center" ><font size=" 4" >Your e-mail has been sent to <%=SendToName%> at <Font Color=" DarkBlue" ><%=SendtoEmail%></Font> regarding <%=objRS(" Name" )%>' s APXOnline Inquiry.</p>
<p align=" center" > </p>
<p align=" center" > </p>
<p align=" center" ><a href=" ../externalDB.asp" >
<img border=" 0" src=" ../../Images/Shared/back.jpg" ></a></p>
</body>
</html> I am new to ASP scripting, and this was my first major undertaking, so maybe I am missing something fundamental. Also of note, if I try to close the objConn and objRS conventionally, I get an error. I think there is a special syntax for doing it in Frontpage...either that or maybe it automatically does it, but I don' t know. The output of the e-mail should look something like this:
An APXOnline Inquiry has been forwarded to you by Petey Pablo at APX Technologies, Inc. The following notes have been included by the sender:
Hi, these are notes. Aren' t they cool? I think they are. You should too, because they are. You can put special instructions here for the distributor or representative that you are e-mailing and he or she will read this in addition to the inquiry you are sending them. Doesn' t that sound like fun? I think so.
--------------------------------------------------------------------------------
External Power APXOnline Inquiry -- 8/20/2002 5:21:25 PM
Company: APX Tech
Address 1: N/A
Address 2: Westbury, NY 11590
Country: USA
Name: < >Chad Baum
Title: Moo Man
Phone: asdf
Fax: asdf
E-mail: asdf
Contact: Fax
Product: Existing
Needed: 3_to_6_Months
Primary Input Voltage: N/A
Primary Input Frequency: N/A
Universal Minimum Voltage: N/A
Universal Maximum Voltage: N/AClass: N/A
1st Output Voltage: N/A
1st Output Current: N/A
1st Minimum Load: N/A
2nd Output Voltage: N/A
2nd Output Current: N/A
2nd Minimum Load: N/A
3rd Output Voltage: N/A
3rd Output Current: N/A
3rd Minimum Load: N/A
4th Output Voltage: 4th Output Current: N/A
4th Minimum Load: N/A
Ripple Max: N/A
Percentage Overall: N/A
Noise: N/A
Configuration: N/A
Length: N/A
Width: N/Av
Height: N/A
Unit: N/A
Output Connector Type: N/A
N/A
Quantity: N/A
Environmental Conditions: N/A
Safety Agency Requirements: N/A
Notes: N/A
Some of the lines are messed up, yet they are identical in the code, and they change from time to time. Thanks for your help... -Chad
|
|
|
|