Hi there, I'm doing a website for a company I work for and I need to have data from a form sent to our email address without the usual outlook express opening. I'm having issues with the coding, so here's the deal. The form gathers info from the customer, and gives them a quote for their lawn dimensions after they hit submit. For my form, after I enter info and hit submit, it either says page cannot be displayed or tries to open the code as a file. Here's the code:
Form
<FORM ACTION="formtomail.asp" METHOD=post>
<table width="75%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>name:</td>
<td colspan="2">
<input type="text" name="name">
</td>
</tr>
<tr>
<td>email:</td>
<td colspan="2">
<input type="text" name="email">
</td>
</tr>
<tr>
<td>message:</td>
<td colspan="2">
<textarea name="message" cols="40" rows="5"></textarea>
</td>
</tr>
<tr>
<td> </td>
<td colspan="2">
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Reset" value="Reset">
</td>
</tr>
</table>
<INPUT TYPE=submit value="Submit">
</FORM>
Code
formtomail.asp
<%
For Each x In Request.Form
message = message & x & ": " & Request.Form(x) & CHR(10)
Next
set smtp=Server.CreateObject("Bamboo.SMTP")
smtp.Server="[email protected]"
smtp.Rcpt="[email protected]"
smtp.From="[email protected]"
smtp.FromName="Joe Smith"
smtp.Subject="Response to my form"
smtp.Message = message
on error resume next
smtp.Send
if err then
response.Write err.Description
else
Response.redirect ("http:// redirect.com")
end if
set smtp = Nothing
%>
Im sure my SMTP is wrong, but I really only need help with placement of the script, but any suggestions would be appreciated...tell me what I dont know.
Any help would be awesome.
Thanks.
Form
<FORM ACTION="formtomail.asp" METHOD=post>
<table width="75%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>name:</td>
<td colspan="2">
<input type="text" name="name">
</td>
</tr>
<tr>
<td>email:</td>
<td colspan="2">
<input type="text" name="email">
</td>
</tr>
<tr>
<td>message:</td>
<td colspan="2">
<textarea name="message" cols="40" rows="5"></textarea>
</td>
</tr>
<tr>
<td> </td>
<td colspan="2">
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Reset" value="Reset">
</td>
</tr>
</table>
<INPUT TYPE=submit value="Submit">
</FORM>
Code
formtomail.asp
<%
For Each x In Request.Form
message = message & x & ": " & Request.Form(x) & CHR(10)
Next
set smtp=Server.CreateObject("Bamboo.SMTP")
smtp.Server="[email protected]"
smtp.Rcpt="[email protected]"
smtp.From="[email protected]"
smtp.FromName="Joe Smith"
smtp.Subject="Response to my form"
smtp.Message = message
on error resume next
smtp.Send
if err then
response.Write err.Description
else
Response.redirect ("http:// redirect.com")
end if
set smtp = Nothing
%>
Im sure my SMTP is wrong, but I really only need help with placement of the script, but any suggestions would be appreciated...tell me what I dont know.
Any help would be awesome.
Thanks.