Discuss Asp email form on godaddy in the ASP Development forum on ASP Free. Asp email form on godaddy ASP Development forum discussing ASP related topics including coding practices, ASP tips, and more. Active Server Pages (ASP) enables you to empower your HTML pages dynamically with robust scripting options.
ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month!
Receive the tools necessary to be the rock star of your field. Our 12-month program teaches you the evolving world of multi-channel marketing as well as the complex issues and opportunities found in the industry.
Web development can be a daunting task, even for specialists. There is a lot of information to absorb and a lot of technologies to learn in order to manage a superior website. When trying to learn the ropes, developers need a reliable source to introduce new ideas that can be easily implemented. When working on large projects, even web veterans may run into a technology or an aspect of a technology that they are unfamiliar with.
Posts: 9
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:
' 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)
%>
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
%>
Posts: 9
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!
Posts: 13,608
Time spent in forums: 5 Months 4 Days 20 h 5 m 18 sec
Reputation Power: 2460
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.
Posts: 9
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.
Posts: 13,608
Time spent in forums: 5 Months 4 Days 20 h 5 m 18 sec
Reputation Power: 2460
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 04:23 PM.
Posts: 1
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.
Posts: 1
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.
Posts: 1,616
Time spent in forums: 1 Week 3 Days 1 h 3 m 49 sec
Reputation Power: 452
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.