sward
01-15-2010, 01:18 PM
Hi I am trying to get a simple form to work. It is hosted with Godaddy which is always a problem with ANY email issues. I know it has to be something very simple. The form seems to process but never ends up in the inbox. Please help I know you guys get bored with these types of questions but it would be greatly appreciated. I read somewhere that IIS 6.0 no longer acccepts (Cdonts) yet Godaddy uses it in their help example (go figure typical of them)
Note from Godaddy:
Use the following relay server in your ASP.NET 3.5 code:
relay-hosting.secureserver.net
You do not need to provide a user name and password for this relay server.
but they don't tell you where it needs to go in the code.
Here is my asp page
<%
' declare variables
Dim EmailFrom
Dim EmailTo
Dim Subject
Dim Name
Dim Address
Dim City
Dim State
Dim PostCode
Dim Tel
Dim Comments
' get posted data into variables
EmailFrom = Trim(Request.Form("EmailFrom"))
EmailTo = "myemail@myaddress.com"
Subject = Trim(Request.Form("Subject"))
Name = Trim(Request.Form("Name"))
Address = Trim(Request.Form("Address"))
City = Trim(Request.Form("City"))
State = Trim(Request.Form("State"))
PostCode = Trim(Request.Form("PostCode"))
Tel = Trim(Request.Form("Tel"))
Comments = Trim(Request.Form("Comments"))
' validation
Dim validationOK
validationOK=true
If (Trim(EmailFrom)="") Then validationOK=false
If (validationOK=false) Then Response.Redirect("error.htm?" & EmailFrom)
' prepare email body text
Dim Body
Body = Body & "Name: " & Name & VbCrLf
Body = Body & "Address: " & Address & VbCrLf
Body = Body & "City: " & City & VbCrLf
Body = Body & "State: " & State & VbCrLf
Body = Body & "PostCode: " & PostCode & VbCrLf
Body = Body & "Tel: " & Tel & VbCrLf
Body = Body & "Comments: " & Comments & VbCrLf
' send email
Dim mail
Set mail = Server.CreateObject("CDONTS.NewMail")
mail.To = EmailTo
mail.From = EmailFrom
mail.Subject = Subject
mail.Body = Body
mail.Send
Set Mail=nothing
' redirect to success page
Response.Redirect("thankyou.html")
%>
And form page code: http://www.patmargo.com/index-6.html
<form method="POST" action="contact.asp">
Fields marked (*) are required
<p>Email From:* <br>
<input name="EmailFrom" type="text" size="40" span class="style4" >
<p>Subject: <br>
<input name="Subject" type="text" size="50" span class="style4">
<p>Name:<br>
<input name="Name" type="text" size="40"span class="style4">
<p>Address:<br>
<input name="Address" type="text" size="50" span class="style4">
<p>City:<br>
<input name="City" type="text" size="50" span class="style4"b>
<p>State:<br>
<input type="text" name="State" span class="style4" >
<p>PostCode:<br>
<input type="text" name="PostCode" span class="style4">
<p>Tel:<br>
<input name="Tel" type="text" size="30" span class="style4" >
<p>Comments:<br>
<textarea name="Comments"span class="style4"></textarea>
<p><input type="submit" name="Submit" span class="style4" value="Submit">
</form>
If this is going to take more than a "simple" fix PLEASE let me know.
Note from Godaddy:
Use the following relay server in your ASP.NET 3.5 code:
relay-hosting.secureserver.net
You do not need to provide a user name and password for this relay server.
but they don't tell you where it needs to go in the code.
Here is my asp page
<%
' declare variables
Dim EmailFrom
Dim EmailTo
Dim Subject
Dim Name
Dim Address
Dim City
Dim State
Dim PostCode
Dim Tel
Dim Comments
' get posted data into variables
EmailFrom = Trim(Request.Form("EmailFrom"))
EmailTo = "myemail@myaddress.com"
Subject = Trim(Request.Form("Subject"))
Name = Trim(Request.Form("Name"))
Address = Trim(Request.Form("Address"))
City = Trim(Request.Form("City"))
State = Trim(Request.Form("State"))
PostCode = Trim(Request.Form("PostCode"))
Tel = Trim(Request.Form("Tel"))
Comments = Trim(Request.Form("Comments"))
' validation
Dim validationOK
validationOK=true
If (Trim(EmailFrom)="") Then validationOK=false
If (validationOK=false) Then Response.Redirect("error.htm?" & EmailFrom)
' prepare email body text
Dim Body
Body = Body & "Name: " & Name & VbCrLf
Body = Body & "Address: " & Address & VbCrLf
Body = Body & "City: " & City & VbCrLf
Body = Body & "State: " & State & VbCrLf
Body = Body & "PostCode: " & PostCode & VbCrLf
Body = Body & "Tel: " & Tel & VbCrLf
Body = Body & "Comments: " & Comments & VbCrLf
' send email
Dim mail
Set mail = Server.CreateObject("CDONTS.NewMail")
mail.To = EmailTo
mail.From = EmailFrom
mail.Subject = Subject
mail.Body = Body
mail.Send
Set Mail=nothing
' redirect to success page
Response.Redirect("thankyou.html")
%>
And form page code: http://www.patmargo.com/index-6.html
<form method="POST" action="contact.asp">
Fields marked (*) are required
<p>Email From:* <br>
<input name="EmailFrom" type="text" size="40" span class="style4" >
<p>Subject: <br>
<input name="Subject" type="text" size="50" span class="style4">
<p>Name:<br>
<input name="Name" type="text" size="40"span class="style4">
<p>Address:<br>
<input name="Address" type="text" size="50" span class="style4">
<p>City:<br>
<input name="City" type="text" size="50" span class="style4"b>
<p>State:<br>
<input type="text" name="State" span class="style4" >
<p>PostCode:<br>
<input type="text" name="PostCode" span class="style4">
<p>Tel:<br>
<input name="Tel" type="text" size="30" span class="style4" >
<p>Comments:<br>
<textarea name="Comments"span class="style4"></textarea>
<p><input type="submit" name="Submit" span class="style4" value="Submit">
</form>
If this is going to take more than a "simple" fix PLEASE let me know.