<% ' ******************************************************************* ' * This is the ASP E-mail Function * ' * You can modify this file as you like and you * ' * can also rename it. It will still work. * ' * * ' * You can edit all colors with the following script: * ' * * ' * Variable Explanation * ' * --------------------------------------------------------------- * ' ******************************************************************* BodyBgcolor = "#000000" '* Body background color * LinkColor = "#ffffff" '* Link color * ALinkColor = "#ffffff" '* Active link color * VLinkColor = "#ffffff" '* Visited link color * TextColor = "#33ff00" '* Default text color * HoverColor = "#ff0000" '* Default hover color (Mouse over link) * TopcellBg = "#000000" '* Heading row background color in tables * TopcellText = "#33ff00" '* Heading row text color in tables * CellBg = "#000000" '* Table background color * CellText = "#33ff00" '* Table Text color * ' ******************************************************************* ' * Other things to edit * ' * * ' * Variable Explanation * ' * --------------------------------------------------------------- * ' ******************************************************************* Font = "Arial" '* The default font * DataBaseName = "../../database/mail.mdb"'* Database + virtual path * ' ******************************************************************* ' * Copyright (c) 1999 by Sakarías Ingólfsson * ' * homepage: http://sakki.ewebcity.com or * ' * http://www.welcome.to/sakki (referrer) * ' * email sakki22@hotmail.com * ' ******************************************************************* session("fn") = "mail.asp" ' ----------------------------------------- ' Begin Inputting external data ' ----------------------------------------- ' <<<< Querystring >>>> Mode = Request.QueryString("Mode") 'Sign (or View) Page = Request.QueryString("Page") 'In View mode ShowTheCode = "yes" If IsEmpty(Request.QueryString("Page")) then Page = 1 ' <<<< Form >>>> Flag = Request.Form("Flag") If mode = "Sign" then Name = Request.Form("Name") Email = Request.Form("Email") Comment = Request.Form("Comment") End If ' <<<< Server >>>> NameOfFile = Request.ServerVariables("Script_Name") HomePage = "../menu/01_start.htm" ' ----------------------------------------- ' End Inputting external data ' ----------------------------------------- ' ********************************************************************* ' * Sub list: * ' ********************************************************************* ' * Header * The etc. tags * ' * Footer * The etc. tags * ' * Signpage * The tags for the sign/Addentry page * ' * Validate * Validate the signpage * ' * InsertInfo * Insert info to database * ' * Viewpage * View entries * ' ********************************************************************* ' * Database: mail.mdb Table: mail Primary key: Id * ' ********************************************************************* ' |Id |Date |Name |Email |Place |Url |Comment ' |Autonum |Date/Time |Text-30 |Text-30 |Text-50 |Text-50 |Memo ' ********************************************************************* ' ------------------------------------------- ' Begin Subs and functions ' ------------------------------------------- '<<<<<<<<<<<<>>>>>>>>>>>> Sub Header 'Header Sub %> Noordeloos Informatica Support
Send E-mail Message

<% End Sub '<<<<<<<<<<<<>>>>>>>>>>>> Sub Footer 'Footer Sub %> <% Response.End End Sub '<<<<<<<<<<<<>>>>>>>>>>>> Sub SignPage 'The page where Guests can input their Information %>

Name:
Email:
Message:

<% End Sub '<<<<<<<<<<<<>>>>>>>>>>>> Function Validate Dim ErrorMsg ErrorMsg = "" If Not ErrorMsg = "" then Response.write " The e-mail message could not be sent due to the following errrors:
" Response.write ErrorMsg Response.write "

" Validate = False Else Validate = True End if End Function '<<<<<<<<<<<<>>>>>>>>>>>> Sub InsertInfo Comment = Replace(Comment,VbCrlf,"
") Comment = Replace(Comment,Chr(34),""") Comment = Replace(Comment, "'", "''") set conn = server.createobject("adodb.connection") DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; " DSNtemp=dsntemp & "DBQ=" & server.mappath(DataBaseName) conn.Open DSNtemp sqlstmt = "Insert into mail (Name,Email,Comment)" sqlstmt = sqlstmt & " Values(" sqlstmt = sqlstmt & "'" & Name & "'," sqlstmt = sqlstmt & "'" & Email & "'," sqlstmt = sqlstmt & "'" & Comment & "'" sqlstmt = sqlstmt & ")" conn.execute(sqlstmt) conn.close set conn = nothing End Sub '<<<<<<<<<<<<>>>>>>>>>>>> ' ----------------------------------------- ' End Subs and Functions ' ----------------------------------------- ' Begin Main ' ----------------------------------------- 'Sign mode If Flag = "" then 'If form has not been submitted, no flag is recognised WhatToDo = "Send E-mail Message" Header SignPage Footer End If If Flag = 1 then 'If form has been submitted, flag will be set to 1 WhatToDo = "Sign Guestbook" Header If Not Validate then 'The "Validate" function writes Error message Signpage Else InsertInfo Response.write " Your e-mail message has been sent successfully.

" Response.write " Thanks for your time and hope to hear from you again!

" Response.write " Return to Noordeloos Informatica Support homepage
" Footer End If Footer End If ' ----------------------------------------- ' End Main ' ----------------------------------------- %>