Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
I can't get my contact form to work pls help
Old 07-20-2008, 03:01 PM I can't get my contact form to work pls help
Novice Talker

Posts: 5
Name: Rob
Trades: 0
Ok ive been messing around with a flash template my buddy bought online and we have everything set up but we cant get the contact form to send the info to his email. The file form05configuration.xml script looks like this:

<?xml version="1.0" encoding="utf-8"?>
<!--
-- Please read this information to learn how to set up the contact form integrated
-- into the template.
--
-- This readme file explains in details the meaning of the settings that can be
-- done in the fcContactFormConfiguration.xml configuration file.
--
-- It is recommended for you to use an XML editor to m
ake changes to this file
-- because it’s less possible to make an error in the markup which can cause to
-- a not working contact form.
-->

<contactFormConfiguration>

<!--
-- An e-mail address which will be used to receive messages from your contact form.
-- You can specify several e-mail addresses separating them with a comma.
-- For example:
first_email@domain.com, second_email@domain.com, third@domain.com
-->
<emailTo>info@alphaprevention.com</emailTo>

<!--
-- A server script type which will process sending e-mails. It depends on your
-- hosting and in the current version of the contact form it is allowed to use
-- two types: php (Apache, PHP Hosting); asp (IIS web server, ASP).
-->
<serverProcessorType>php</serverProcessorType>

<!--
-- A name of the script file which process sending e-mails on your server (without
-- extension). The name contact is used by default.
-->
<serverProcessorFileName>contact</serverProcessorFileName>

<!--
-- Set whether to validate only required fields (true/false). The default value is
-- true which means the not required fields of your contact form will not be validated.
-- For example if the e-mail field of your form is set as not required (imagine it)
-- the form will be processed even if the user types in an incorrect e-mail address.
-->

<validateRequiredOnly>false</validateRequiredOnly>

<!--
-- Set whether to submit the form when the Enter key is pressed even if the focus is
-- not on the Submit button (true/false).
-->
<submitFormOnEnter>false</submitFormOnEnter>

<!--
-- Text showing to the user when the form is submitted without any errors.
-->
<messageSentText>Thank you for your message.</messageSentText>

<!--
-- Text showing in case the form is not submitted because of a server error.
-->
<messageSentFailedText>Sorry, your message couldn't be sent.</messageSentFailedText>

<!--
-- Text your visitor will see while waiting till the processing is over.
-->
<formProcessingText>processing...</formProcessingText>

<!--
-- Your SMTP server (for ASP only).
-->
<smtpServer>localhost</smtpServer>

<!--
-- Your SMTP port (for ASP only).
-->
<smtpPort>25</smtpPort>

<!--
-- Set whether to send the message as a plain text (true) or as HTML (false).
-->
<plainText>false</plainText>

<!--
-- ID of the input field (in the structure XML file) to use for the “from: ”
-- or email to use instead (for example:
mailfrom@domainname.com).
-->
<emailFromSource>2</emailFromSource>

<!--
-- Subject of the e-mails that will be sent through this contact form or ID of
-- the input field (in the structure XML file) to use for the “subject: ” label
-- in your e-mail client.
-->
<subjectSource>Contact Form from your site</subjectSource>

</contactFormConfiguration>


Sorry that is soo long. I'm new to this kind of stuff. I took out some of the bottom stuff that had to do with validation of correct email and stuff like that. Hosting is with GoDaddy.
How can I get this to link to his email? Am I doing something wrong?
racasavant is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-21-2008, 10:28 PM Re: I can't get my contact form to work pls help
kline11's Avatar
SearchBliss Web Tools

Posts: 1,788
Name: John
Location: USA
Trades: 0
Where is the ASP code? We can't do much with the XML.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
kline11 is offline
Reply With Quote
View Public Profile
 
Old 07-22-2008, 11:38 AM Re: I can't get my contact form to work pls help
Novice Talker

Posts: 5
Name: Rob
Trades: 0
Ohh sorry, I'm very new to this. Like as in I don't know what I'm doing.
Here is the contact.asp

<%
'----function that removes html tags-----------
Function RemoveHTML( strText )
Dim RegEx
Set RegEx = New RegExp
RegEx.Pattern = "<[^>]*>"
RegEx.Global = True
RemoveHTML = RegEx.Replace(strText, "")
End Function
'---------------------------------------------

'------defining script vars-------------------
Dim mailObj, mailCfg, myBody, fld
Dim RegEx
set RegEx = New RegExp
'--------------------------------------------
'------getting data sent by flash (filtering configuration data)------------
For Each fld in Request.Form
If Request.Form(fld) <> "" and _
fld <> "mail_to" and _
fld <> "smtp_server" and _
fld <> "smtp_port" and _
fld <> "plain_text" and _
fld <> "mail_from" and _
fld <> "mail_subject" Then
myBody = myBody & vbCRLF & " <b>" & fld & "</b> :<br/> " & Trim(Request.Form(fld)) & "<br/>"
End If
Next
'---------------------------------------------------------------------------
'----------setting conf data------------------------------------------------
On Error Resume Next
Set myMail = CreateObject("CDO.Message")
myMail.Subject = Request.Form("mail_subject")
myMail.From =Request.Form("mail_from")
myMail.To = Request.Form("mail_to")

'--------if plain text is set to true removing html---------------------------------------
if Request.Form("plain_text") = "true" then

myMail.TextBody = RemoveHTML(myBody)
'-------otherwise composing message body--------------------------------------------------
else myMail.HTMLBody = "<html><body>" & myBody & "</body></html>"

end if
'----------setting configuration params for smtp----------------------------------------------------------------------------------
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/con...tion/sendusing") = 1
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/con...ion/smtpserver") = Request.Form("smtp_server")
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/con...smtpserverport") = Request.Form("smtp_port")
myMail.Configuration.Fields.Update
'---------------------------------------------------------------------------------------------------------------------------------
myMail.Send '---------------sending message

If Err = 0 Then
Response.Write("&mail=1") 'if there the message is sent return 1 to flash
Else
Response.Write("&mail=0") 'otherwise return 0
End If

%>


I have not edited this at all from the original version so there probablly is something in there that I would have to edit to goto my site. There is also a gdform.asp if you need that. It didn't really look like it had anything to do with the email part but I would have no idea.

Last edited by racasavant; 07-22-2008 at 11:47 AM..
racasavant is offline
Reply With Quote
View Public Profile
 
Old 07-22-2008, 11:49 AM Re: I can't get my contact form to work pls help
Novice Talker

Posts: 5
Name: Rob
Trades: 0
Hehe might as well post the gdform.asp as well.

<%
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
%>
racasavant is offline
Reply With Quote
View Public Profile
 
Old 07-22-2008, 01:48 PM Re: I can't get my contact form to work pls help
kline11's Avatar
SearchBliss Web Tools

Posts: 1,788
Name: John
Location: USA
Trades: 0
Now what exactly is the error message you are getting? Or does it "do nothing".
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
kline11 is offline
Reply With Quote
View Public Profile
 
Old 07-22-2008, 04:03 PM Re: I can't get my contact form to work pls help
Novice Talker

Posts: 5
Name: Rob
Trades: 0
when you try to submit it says "Sorry, your message couldn't be sent"
The website is www.alphaprevention.com it still needs some work like the font color of the contact form and stuff liek that so don't mind that :P

I've been searching online and I've just read that I need to have the form be directed to gdform.asp but I still don't know how to do that.
racasavant is offline
Reply With Quote
View Public Profile
 
Old 07-25-2008, 09:29 PM Re: I can't get my contact form to work pls help
Novice Talker

Posts: 5
Name: Rob
Trades: 0
bumpp
racasavant is offline
Reply With Quote
View Public Profile
 
Old 08-06-2008, 11:27 AM Re: I can't get my contact form to work pls help
Junior Talker

Posts: 4
Trades: 0
I would suggest checking out the tutorials at asp.net or aspnettutorials.com. Good luck!
Ventito is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to I can't get my contact form to work pls help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.33093 seconds with 12 queries