View Full Version : Emails from Forms in front page
RickRoy
2008-07-29, 02:41 PM
I am using Front Page to create fill-in forms. I need a form that can be filled out on line, posted to a spreadsheet and the data emailed to the appropriate person. This used to happen in the past on myhosting.com but over recent years, we haven’t been able to get the email notifications and it is important that we do. We still can download the csv data but we would like the heads-up achieved with the emails that a new posting has been submitted. Ideas anyone?
community-manager
2008-08-04, 06:15 AM
Hello RickRoy,
That is interesting, I will look into your problem and see if I can come up with a solution.
Thanks,
tonyp
2008-08-05, 12:32 PM
You need to hire a programmer to build the page for you. What you need is something simple so an experienced programmer should take more that 30 min to create the page.
Below is a sample of how the page will work. Save the code to a file named email.asp and place it on your site. Then visit the page by going to http://yourdomainname.com/email.asp. The page will ask for an email address. When the form is submitted it will save the email address to a file named /cgi-bin/EmailAddresses.csv and it will send an email. Replace yourdomainname.com in the code with your actual domain name.
<html>
<head>
</head>
<body>
<%
if Request.Form("SubmitForm") = "1" then
Dim EmailAddress
EmailAddress = Request("EmailAddress")
'write to csv file
Dim FileName
FileName = Server.MapPath("/cgi-bin/") & "\EmailAddresses.csv"
'Response.Write(FileName)
'Response.End
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Dim objLogFile
Set objLogFile = objFSO.OpenTextFile(FileName, 8, True)
objLogFile.Writeline(EmailAddress)
objLogFile.Close
'send an email
Dim MyJMail
Set MyJMail = Server.CreateObject("JMail.Message")
MyJMail.Logging = True
MyJMail.From = "person@yourdomainname.com"
MyJMail.FromName = "My Name"
MyJMail.Subject = "Email Address"
MyJMail.AddRecipient("person@yourdomainname.com")
MyJMail.Body = "Form submitted with " & EmailAddress
Dim SendValue
SendValue = MyJMail.Send("mail.yourdomainname.com")
'Response.Write(SendValue)
'Response.End
%>
The email address has been written to file and an email has been sent.</p>
<%
else
%>
<form method="POST" action="email.asp">
<input type="hidden" name="SubmitForm" Value="1"></p>
Enter your email address.
<input type="text" name="EmailAddress" size="20"></p>
<input type="submit" value="Submit" name="B1"></p>
</form>
<%
end if
%>
</body>
</html>
community-manager
2008-08-07, 03:49 AM
Thank you Tony...