> Du må da lige komme med noget kildekode, da vi ellers ikke kan
gætte
> hvor problemet er.
Naturligvis !!
<%
' build particulars
method = Request.ServerVariables("HTTP_METHOD")
recipient = Request("recipient")
Subject = Request("Subject")
excludeflds = split(Request("exclude"),",")
fromemail = "website@sloejd-fyn.dk"
defemail = "hoermann@sol.dk" '" &
trim(Replace(Request.ServerVariables("HTTP_HOST"),"
www.",""))
redirect = Request("redirect")
mailserver = Request("mailserver")
' set defaults if not specified
If mailserver = "" Then
mailserver = defmailserver
End If
If redirect = "" Then
redirect = "http://" & Request.ServerVariables("HTTP_HOST")
End If
If subject = "" Then
Subject = "Results of form posted from " &
Request.ServerVariables("HTTP_REFERER") & " - " & now()
End If
If recipient = "" Then
recipient = defemail
End If
If fromemail = "" Then
fromemail = defemail
End If
' determine the method of the form (post
' or get)
Select Case lcase(method)
Case "post"
'build a delimited list of the field names
For Each fld In Request.Form
' remove the fieldnames of the email configuration fields
Select Case lcase(fld)
Case
"exclude","email","subject","recipient","redirect","mailserver"
' Do nothing
Case Else
tmpfldnames = tmpfldnames & fld & ","
End Select
Next
Case "get"
'build a delimited list of the field names
For Each fld In Request.QueryString
' remove the fieldnames of the email configuration fields
Select Case fld
Case "exclude","email","subject","recipient"
' Do nothing
Case Else
tmpfldnames = tmpfldnames & fld & ","
End Select
Next
End Select
' remove the trailing comma
If mid(tmpfldnames,len(tmpfldnames),1) = "," Then
tmpfldnames = mid(tmpfldnames,1,len(tmpfldnames)-1)
End If
' build an array of the fieldnames
fldarray = split(tmpfldnames,",")
' build the message header
bodytext = "Form results posted " & now() & vbcrlf &
"=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-" & vbcrlf
' cycle through all of the fields
For Each fld In fldarray
PrintFld = True
' exclude fields In the exclude list
For Each checkfld In excludeflds
If trim(lcase(checkfld)) = trim(lcase(fld)) Then
PrintFld = False
End If
Next
' continue building the mail message wit
' h the form results
If PrintFld = True Then
bodytext = bodytext & fld & ": " & request(fld) & vbcrlf
End If
next
sentbin =
sendmail("website@sloejd-fyn.dk",recipient,subject,bodytext)
Select Case sentbin
Case True
Response.Redirect(redirect)
Case False
Response.write("Der forekom problemer ved afsendelse af
formularen, tryk ""tilbage"" og prøv venligst igen!.")
End Select
Function SendMail(From,Rcpt,Subject,Body)
Set objMailer = CreateObject("CDONTS.Newmail")
objMailer.From = From
objMailer.To = Rcpt
objMailer.Subject = Subject
objMailer.Body = Body
objMailer.Send
Set objMailer = Nothing
SendMail = true
End Function
%>
--
Brug Validator service:
http://www.html.dk/validator
- Tast din URL én gang, og validér dokumentet hos 12 validatorer
- Understøtter HTML, CSS og søgemaskineoptimering