ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

Closed Thread
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old May 17th, 2006, 01:56 PM
nfl2k22 nfl2k22 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 9 nfl2k22 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 9 m 46 sec
Reputation Power: 0
Asp email form on godaddy

i have a form i'm using and would like to embed it into my site. i've set up a test location on my godaddy server which is asp enabled. my problem is that when I go to submit my completed for, I get

'page cannot be displayed' error. Here is my form:

http://www.plymouthtravelvet.com/test/contact.htm

here is my asp code:

<%


' declare variables
Dim EmailFrom
Dim EmailTo
Dim Subject
Dim Name
Dim Address
Dim City
Dim State
Dim PostCode
Dim Tel
Dim Department
Dim Website

' get posted data into variables
EmailFrom = "xxxx@gmail.com"
EmailTo = "xxxxx@gmail.com"
Subject = "xxxxxx"
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"))
Department = Trim(Request.Form("Department"))
Website = Trim(Request.Form("Website"))

' validation
Dim validationOK
validationOK=true
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 & "Department: " & Department & VbCrLf
Body = Body & "Website: " & Website & VbCrLf

' send email
Dim mail

using System.Web.Mail;

private void SendEmail()
{
const string SERVER = "relay-hosting.secureserver.net";


MailMessage Mail = new System.Web.Mail.MailMessage();
mail.To = EmailTo
mail.From = EmailFrom
mail.Subject = Subject
mail.Body = Body
SmtpMail.SmtpServer = SERVER;
SmtpMail.Send(Mail);
Mail = null; // free up resources

}

' redirect to success page
Response.Redirect("ok.htm?" & EmailFrom)
%>



some of this was taken from here

Why won't the form send me an email? what changes should i make to my asp code? thanks!

Reply With Quote
  #2  
Old May 17th, 2006, 02:09 PM
nfl2k22 nfl2k22 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 9 nfl2k22 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 9 m 46 sec
Reputation Power: 0
I also noticed that godaddy put 'gdform.asp' on my root, here is the source if you think it would help us figure out what we need to do:

<%

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
%>

Reply With Quote
  #3  
Old May 17th, 2006, 03:35 PM
nfl2k22 nfl2k22 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 9 nfl2k22 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 9 m 46 sec
Reputation Power: 0
nothin eh?

Reply With Quote
  #4  
Old May 17th, 2006, 04:12 PM
mehere's Avatar
mehere mehere is offline
Senior Sarcasm Wizardess
ASP Free God 17th Plane (13000 - 13499 posts)
 
Join Date: Feb 2005
Location: Dreamland
Posts: 13,237 mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)  Folding Points: 10976 Folding Title: Novice Folder
Time spent in forums: 5 Months 1 Day 20 h
Reputation Power: 2012
are you using Classic ASP or ASP.NET? The link you posted for the code is .NET. which would mean that your page should end with .aspx not .asp.

also, if you turn off friendly error messages on your browser, you would get a better error message:
Code:
Microsoft VBScript compilation error '800a0401' 

Expected end of statement 

/test/contact.asp, line 49 

using System.Web.Mail;
---------------------^

so it's telling you that line 49 on your contact.asp page is where the error is. which is the line using System.Web.Mail which is a .NET statement.
__________________
Come JOIN the party!!!

Quote of the Month:
Pretension: The downside of being better than everyone else is that people tend to assume you're pretentious.

Questions to Ponder:
You can be overwhelmed and underwhelmed, but why can't you be simply whelmed?

iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm")
copyright© 2008 sbenj69

Reply With Quote
  #5  
Old May 17th, 2006, 04:17 PM
nfl2k22 nfl2k22 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 9 nfl2k22 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 9 m 46 sec
Reputation Power: 0
so line 49 needs to be changed, but what do I need to do to ensure a correctly formatted asp page? Im completely new to this, but i'm confident once i see a working example I will get the hang of it, thanks!

Reply With Quote
  #6  
Old May 17th, 2006, 04:20 PM
mehere's Avatar
mehere mehere is offline
Senior Sarcasm Wizardess
ASP Free God 17th Plane (13000 - 13499 posts)
 
Join Date: Feb 2005
Location: Dreamland
Posts: 13,237 mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)  Folding Points: 10976 Folding Title: Novice Folder
Time spent in forums: 5 Months 1 Day 20 h
Reputation Power: 2012
again ... are you using ASP or .NET? ... you need to figure this out first. If it's .NET, then you should post this question in the .NET forum. if you're using regular ASP, there is a lot of help in this forum for ASP Email with CDOSYS, just run a search.

Reply With Quote
  #7  
Old May 17th, 2006, 04:28 PM
nfl2k22 nfl2k22 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 9 nfl2k22 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 9 m 46 sec
Reputation Power: 0
Honestly, I'm not quite sure. A doctor (vet) is friends with my parents and I'm doing this site for him for free - I've built sites with dreamweaver before, but he has requested an email form so his clients can post questions or buy product from him through the site. That said, I used a form generator from here to make the thing:

http://www.tele-pro.co.uk/scripts/contact_form/

The script language says 'asp' so i assume classic asp. thank you for your help.

Reply With Quote
  #8  
Old May 17th, 2006, 05:15 PM
mehere's Avatar
mehere mehere is offline
Senior Sarcasm Wizardess
ASP Free God 17th Plane (13000 - 13499 posts)
 
Join Date: Feb 2005
Location: Dreamland
Posts: 13,237 mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)mehere User rank is General 15th Grade (Above 100000 Reputation Level)  Folding Points: 10976 Folding Title: Novice Folder
Time spent in forums: 5 Months 1 Day 20 h
Reputation Power: 2012
i went and looked at your form generator and since i'm not sure whether GoDaddy uses CDONTS or CDOSYS ... try using the code that the form generator created for contact.asp with your form and see if that works ... (it's using CDONTS), if it doesn't we can then convert that code to CDOSYS.

i would suggest not using goDaddy's ASP Form Mailer. which is the page it created for you (gdform.asp)

[edit]just ran a test on godaddy's hosting, they run both CDONTS and CDOSYS ... so the code that your code generator created for contact.ASP should work as is.

Last edited by mehere : May 17th, 2006 at 05:23 PM.

Reply With Quote
  #9  
Old June 8th, 2006, 05:29 PM
windsorguy13 windsorguy13 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Posts: 1 windsorguy13 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 19 sec
Reputation Power: 0
Wrong language...

It's because the "mail" method and code is C#. Asp won't run with C# as the language. The code you got from the web is for ASP.NET, not asp. These links may help, if not, check google for links on sending email using VBScript.

URL

URL

Hope this helps!
Brian

Reply With Quote
  #10  
Old September 6th, 2006, 11:57 AM
smayman smayman is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2006
Posts: 1 smayman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 29 sec
Reputation Power: 0
I am having a similar problem

I am having a similar problem with an asp mail form on godaddy.com. I turned off the friendly error messages on my browser and still get the stupid godaddy error page. My page is at www.saramayman.com/panoramic/contact.asp.

Quote:
Originally Posted by mehere
are you using Classic ASP or ASP.NET? The link you posted for the code is .NET. which would mean that your page should end with .aspx not .asp.

also, if you turn off friendly error messages on your browser, you would get a better error message:
Code:
Microsoft VBScript compilation error '800a0401' 

Expected end of statement 

/test/contact.asp, line 49 

using System.Web.Mail;
---------------------^

so it's telling you that line 49 on your contact.asp page is where the error is. which is the line using System.Web.Mail which is a .NET statement.

Reply With Quote
  #11  
Old September 6th, 2006, 12:48 PM
mystic7's Avatar
mystic7 mystic7 is offline
Contributing User
Click here for more information.
 
Join Date: Sep 2006
Posts: 1,480 mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level)mystic7 User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 11 h 6 m 20 sec
Reputation Power: 270
I run both aspx and asp on my domain on a godaddy server. I also have a problem with sending email. I think it's a godaddy configuration issue which someone figured out a workaround to, just waiting for him to remember what it was and get back to me.

Reply With Quote
  #12  
Old September 6th, 2006, 02:22 PM
RChicken's Avatar
RChicken RChicken is offline
bawk bawk bawk
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2006
Location: Mayville, WI
Posts: 453 RChicken User rank is Second Lieutenant (5000 - 10000 Reputation Level)RChicken User rank is Second Lieutenant (5000 - 10000 Reputation Level)RChicken User rank is Second Lieutenant (5000 - 10000 Reputation Level)RChicken User rank is Second Lieutenant (5000 - 10000 Reputation Level)RChicken User rank is Second Lieutenant (5000 - 10000 Reputation Level)RChicken User rank is Second Lieutenant (5000 - 10000 Reputation Level)RChicken User rank is Second Lieutenant (5000 - 10000 Reputation Level)  Folding Points: 7556 Folding Title: Novice Folder
Time spent in forums: 5 Days 11 h 58 m 20 sec
Reputation Power: 62
Send a message via ICQ to RChicken Send a message via AIM to RChicken Send a message via MSN to RChicken Send a message via Yahoo to RChicken Send a message via XFire to RChicken
i'm using a asp sendmail form with godaddy.com and i have never had a single problem with it. if you want i can zip it up and post it on here.

Reply With Quote
  #13  
Old September 13th, 2006, 06:39 PM
StrawberryField StrawberryField is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 3 StrawberryField User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 25 sec
Reputation Power: 0
Hey NFL2k22, did you ever get it to work? If so, can you tell me what you did?

Reply With Quote
  #14  
Old September 14th, 2006, 10:12 PM
HotelInnovation HotelInnovation is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2006
Posts: 1 HotelInnovation User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 51 sec
Reputation Power: 0
I need your help

Quote:
Originally Posted by RChicken
i'm using a asp sendmail form with godaddy.com and i have never had a single problem with it. if you want i can zip it up and post it on here.


I am having problems with my asp mail form and would greatly appreciate any help you could provide. Thanks for everything!

Reply With Quote
  #15  
Old September 15th, 2006, 12:54 PM
SmileSmita SmileSmita is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Posts: 320 SmileSmita User rank is Corporal (100 - 500 Reputation Level)SmileSmita User rank is Corporal (100 - 500 Reputation Level)SmileSmita User rank is Corporal (100 - 500 Reputation Level)SmileSmita User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 3 Days 18 h 13 m 42 sec
Reputation Power: 5
Shouldnt your page name be :
http://www.plymouthtravelvet.com/test/contact.asp
instead of
http://www.plymouthtravelvet.com/test/contact.htm

I mean i hope its an .asp file???the code looks to be ASP code...let me know

Reply With Quote
Closed Thread

Viewing: ASP Free ForumsProgrammingASP Development > Asp email form on godaddy


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
Stay green...Green IT