Hej,
Tidigare har jag haft ett webbformulär på webbsidan som fungerade bra. Men sen uppdaterades allt av mitt webbhotel. Så nu står jag där utan
formulär som man kan kontakta mig med. Efter att ha tittat på olika formulär så tänkte jag att göra det själv. Men.. så lätt var det inte, Det dök upp en massa fel ideligen. Jag vet inget om ASP alls. Men jag har sett att det finns en massa duktiga människor här som vet en hel om detta språk.
Nu till saken. Det jag får upp efter att ha fyllt i formuläret på webbsidan är detta:
Fel som visas i webbläsaren:
Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
/test_4/form_ac.asp, line 19
800401f3
____________________________________
filen form_ac.asp
[kod]
<%@ Language="VBscript" %>
<% Option Explicit %>
<html>
<head>
<title>Message Sent</title>
</head>
<body>
<%
'declare the variables that will receive the values
'receive the values sent from the form and assign them to variables
'note that request.form("name") will receive the value entered into the textfield
'called name, and so with email and message
Dim name, email, message, NewMailObj
name=request.form("name")
email=request.form("email")
message=request.form("message")
'create the mail object and send the details
line 19 Set NewMailObj=Server.CreateObject("CDONTS.NewMail")
line 20 NewMailObj.From = "minmailadress@bladet.se"
line 21 NewMailObj.To = "minmailadress@bladet.se"
NewMailObj.Subject = "New message sent.."
NewMailObj.Body = "the name you entered was " & name & _
"<br>the email was " & email & _
"<br>the message was " & message
'you need to add the following lines FOR the mail to be sent in HTML format
NewMailObj.BodyFormat = 0
NewMailObj.MailFormat = 0
NewMailObj.Send
'Close the email object and free up resources
Set NewMailObj = nothing
Response.write "The email was sent."
%>
</body>
</html>
[/kod]
Vad som är fel vet jag inte.
Hoppas att någon/några kan komma med bra tips om vad som är fel och hur man kan rätta till det.
Kanske även ett litet tips om ett bra formulär som fungerar och hur man kan installera det.
Tack på förhand!
Tidigare har jag haft ett webbformulär på webbsidan som fungerade bra. Men sen uppdaterades allt av mitt webbhotel. Så nu står jag där utan
formulär som man kan kontakta mig med. Efter att ha tittat på olika formulär så tänkte jag att göra det själv. Men.. så lätt var det inte, Det dök upp en massa fel ideligen. Jag vet inget om ASP alls. Men jag har sett att det finns en massa duktiga människor här som vet en hel om detta språk.
Nu till saken. Det jag får upp efter att ha fyllt i formuläret på webbsidan är detta:
Fel som visas i webbläsaren:
Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
/test_4/form_ac.asp, line 19
800401f3
____________________________________
filen form_ac.asp
[kod]
<%@ Language="VBscript" %>
<% Option Explicit %>
<html>
<head>
<title>Message Sent</title>
</head>
<body>
<%
'declare the variables that will receive the values
'receive the values sent from the form and assign them to variables
'note that request.form("name") will receive the value entered into the textfield
'called name, and so with email and message
Dim name, email, message, NewMailObj
name=request.form("name")
email=request.form("email")
message=request.form("message")
'create the mail object and send the details
line 19 Set NewMailObj=Server.CreateObject("CDONTS.NewMail")
line 20 NewMailObj.From = "minmailadress@bladet.se"
line 21 NewMailObj.To = "minmailadress@bladet.se"
NewMailObj.Subject = "New message sent.."
NewMailObj.Body = "the name you entered was " & name & _
"<br>the email was " & email & _
"<br>the message was " & message
'you need to add the following lines FOR the mail to be sent in HTML format
NewMailObj.BodyFormat = 0
NewMailObj.MailFormat = 0
NewMailObj.Send
'Close the email object and free up resources
Set NewMailObj = nothing
Response.write "The email was sent."
%>
</body>
</html>
[/kod]
Vad som är fel vet jag inte.
Hoppas att någon/några kan komma med bra tips om vad som är fel och hur man kan rätta till det.
Kanske även ett litet tips om ett bra formulär som fungerar och hur man kan installera det.
Tack på förhand!
Kommentera