Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Contact Form Help

Status
Not open for further replies.

TBanks79

Technical User
Jun 30, 2009
3
US
Ok I am fairly new to this so here it goes.

I have a form I created in Dreamweaver my server is using CDO mail script to receive emails. I have tried several variations for my contact.asp but to no avail. below is my form code and also the CDO form. i have been trying to fix this for weeks, can someone please help me!

Terrence


<form action="contact.asp" id="Form" method="post">
<div class="wrapper">
<div class="col-1">
<div class="form2">
<div>Name:</div>
<div>
<input type=textbox name="Name:">
</div>
</div>
<div class="form2">
<div>Phone:</div>
<input type=textbox name="Phone:">
</div>
<div class="form2">
<p>Email:</p>
<input type=textbox name="Email:">
</div>
</div>
<div class="col-2">
<div class="form3">
<label>Message:</label>
<textarea cols="1" rows="1"></textarea>
</div><p class="alignright"><a href="" onclick="document.getElementById('form').reset()">Reset</a> &nbsp; &nbsp; &nbsp; <a href="" onclick="document.getElementById('form').submit()">Submit</a></p>
</div> </form>


CDO script that my hosting site created for me


<!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows Library" -->
<!--METADATA TYPE="typelib" UUID="00000205-0000-0010-8000-00AA006D2EA4"
NAME="ADODB Type Library" -->
<%
if Request("submit") <> "" then
Dim objCDO
Set objCDO = Server.CreateObject("CDO.Message")
Dim objCDOConf

Set objCDOConf = Server.CreateObject("CDO.Configuration")
With objCDOConf.Fields
.Item(cdoSendUsingMethod) = 2
.Item(cdoSMTPServer) = "mail-fwd"
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPconnectiontimeout) = 10
.Update
End With
Set objCDO.Configuration = objCDOConf
' Be sure to use a valid email addresses below:
objCDO.From = "terrencebanks@highoctanedevelopments.org"
objCDO.To = "terrencebanks@highoctanedevelopments.org"
objCDO.Subject = "FormMail from " & Request.Form
objCDO.TextBody = "FormMail from " & Request.Form
objCDO.TextBody = objCDO.TextBody & chr(10) & chr(13)
objCDO.TextBody = objCDO.TextBody & "Name: "
objCDO.TextBody = objCDO.TextBody & Request("Name:")
objCDO.TextBody = objCDO.TextBody & chr(10) & chr(13)
objCDO.TextBody = objCDO.TextBody & "Phone: "
objCDO.TextBody = objCDO.TextBody & Request("Phone:")
objCDO.TextBody = objCDO.TextBody & chr(10) & chr(13)
objCDO.TextBody = objCDO.TextBody & "Email: "
objCDO.TextBody = objCDO.TextBody & Request("Email:")
objCDO.TextBody = objCDO.TextBody & chr(10) & chr(13)
objCDO.TextBody = objCDO.TextBody & "Message: "
objCDO.TextBody = objCDO.TextBody & Request("Message:")
objCDO.TextBody = objCDO.TextBody & chr(10) & chr(13)
objCDO.Send

'Clean-up
Set objCDO = Nothing
Set objCDOConf = Nothing

' Happy response. If you would rather,
' change the following to
' Response.Redirect "thanks.html" or similar
Response.Write "Your Message has been sent. Thank you!"
Response.End
end if
%>
 
Hi Terrence,

The one thing that stuck out to me in the ASP code was the line:

Code:
.Item(cdoSMTPServer) = "mail-fwd"

That variable should be set to your SMTP server that you use to send the email. It should also be a fully qualified domain name like mail.yourdomain.com, smtp.yourdomain.com, or yourdomain.com.

Brendan Murtagh - HostMySite.com
Technical Support Representative
bmurtagh@hostmysite.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top