Hi, I am currently using GoDaddy as my ASP.NET / ASP hosting service and am working on an e-mail form. The form works fine and allows a user to input information and then submit it (e-mail information gets sent to me).
However, I am trying to add one text field, which will allow a user to input an e-mail address and then have that same information that is automatically sent to me, also sent to the user. In other words, pretty much copy the user on the e-mail sent.
I'm not the best ASP coder and am using just about all the code/script provided default by GoDaddy; however I would like to add this feature. Please see my code below and advise. Thanks in advance:
CODE
<h1>Creative Brief</h1>
<form method="POST" action="gdform.asp">
Fields marked (*) are required
<div style="float:right">
<p>Final Due Date:<br>
<input type="text" name="FinalDueDate">
</div>
<p>Email From:* <br>
<input type="text" name="EmailFrom">
<p>Project:<br>
<input type="text" name="Project">
<p>Owner:<br>
<input type="text" name="Owner">
<p>Copy E-mail (form submission completed request):<br />
<input type="text" name="CopyMail" />
<br />
<br />
<h2>Design Specs</h2>
<select name="Designspecdropdown">
<option value="Website">Website</option>
<option value="Banners/Logos">Banners/Logos</option>
<option value="Email">Email</option>
<option value="Print">Print</option>
<option value="InterOFfice">Inter-Office</option>
</select>
<p>Size(HxW):<br>
<input type="checkbox" name="Size" value="120x60" />120x60
<input type="checkbox" name="Size" value="120x90" />120x90
<input type="checkbox" name="Size" value="125x125" />125x125
<input type="checkbox" name="Size" value="250x300" />250x300
<input type="checkbox" name="Size" value="468x60" />468x60
<br />
<input type="checkbox" name="Size" value="728x90" />728x90
<input type="checkbox" name="Size" value="120x60" />120x60
<input type="checkbox" name="Size" value="120x240" />120x240
<input type="checkbox" name="Size" value="120x600" />120x600
<input type="checkbox" name="Size" value="160x600" />160x600
<p><input type="checkbox" name="Size" value="Other" />Other:<br>
<input type="text" name="OtherInput" />
<br />
<br />
<h2>Copy / Messaging</h2>
<p>Main:<br>
<input type="text" name="Main">
<p>Primary:<br>
<input type="text" name="Primary">
<p>Secondary:<br>
<input type="text" name="Secondary">
<br />
<br />
<h2>Merchandising / Imagery</h2>
<p>Brand:<br>
<input type="text" name="Brand">
<p>Collection:<br>
<input type="text" name="Collection">
<p>Product Sku:<br>
<input type="text" name="ProductSku">
<p>Image to Use:<br>
<input type="text" name="ImagetoUse">
<p><input type="submit" name="submit" value="Submit">
</form>
ASP Code
CODE
<%
Dim landing_page, host_url
Dim fso, outfile, filename, dirname, myFolder
Dim req_method, key, value
Dim bErr, errStr, bEmpty
On Error resume next
bErr = false
bEmpty = true
errStr = ""
Set fso = Server.CreateObject("Scripting.FileSystemObject")
host_url = Request.ServerVariables("HTTP_HOST")
req_method = Request.ServerVariables("REQUEST_METHOD")
dtNow = Now()
filename = Server.MapPath("\ssfm")
dirname = filename
filename = filename & "\gdform_" & DatePart("M", dtNow) & DatePart("D", dtNow) & DatePart("YYYY", dtNow) & DatePart("N", dtNow) & DatePart("S", dtNow)
Function FormatVariableLine(byval var_name, byVal var_value)
Dim tmpStr
tmpStr = tmpStr & "<GDFORM_VARIABLE NAME=" & var_name & " START>" & vbCRLF
tmpStr = tmpStr & var_value & vbCRLF
tmpStr = tmpStr & "<GDFORM_VARIABLE NAME=" & var_name & " END>"
FormatVariableLine = tmpStr
end function
Sub OutputLine(byVal line)
outfile.WriteLine(line)
end sub
if err.number = 0 then
Set outfile = fso.CreateTextFile(filename, true, false)
if err.number <> 0 then
bErr = true
errStr = "Error creating file! Directory may not be writable or may not exist.<br>Unable to process request."
else
if(req_method = "GET") then
for each Item in request.QueryString
if item <> "" then
bEmpty = false
key = item
value = Request.QueryString(item)
if(lcase(key) = "redirect") then
landing_page = value
else
line = FormatVariableLine(key, value)
Call OutputLine(line)
end if
end if
next
elseif (req_method = "POST") then
for each Item in request.form
if item <> "" then
bEmpty = false
key = item
value = Request.form(item)
if(lcase(key) = "redirect") then
landing_page = value
else
line = FormatVariableLine(key, value)
Call OutputLine(line)
end if
end if
next
end if
outfile.close
end if
if(bEmpty = true) AND errStr = "" then
bErr = true
errStr = errStr & "<br>No variables sent to form! Unable to process request."
end if
if(bErr = false) then
if (landing_page <> "") then
response.Redirect "http://" & host_url & "/" & landing_page
else
response.Redirect "http://" & host_url
end if
else
Response.Write errStr
end if
set fso = nothing
else
Response.Write " An Error Occurred creating mail message. Unable to process form request at this time."
end if
%>