%@ Language=VBScript %> <% if not isempty(Request.Form("Send")) then set conn = server.createobject ("adodb.connection") conn.open "FreeDB_139064", "sa", "yourpassword" CurrentDateTime = Now conn.Execute "insert into FunPostcards (SendersName, SendersEmail, Message, " _ & "RecName, RecEmail, PostcardType, WhenSent) values (" _ & "'" & Request.Form("SendersName") & "', " _ & "'" & Request.Form("SendersEmail") & "', " _ & "'" & Request.Form("Message") & "', " _ & "'" & Request.Form("RecName") & "', " _ & "'" & Request.Form("RecEmail") & "', " _ & "'" & Request.Form("PostcardType") & "', " _ & "'" & CurrentDateTime & "')" set RSID = conn.Execute("select PostcardID from FunPostcards where " _ & "WhenSent = #" & CurrentDateTime & "#") EmailMessage = "You have been sent a postcard! To view it go to: " & chr(13) _ & "http://www.rgstore.com/free/postcards/index.asp?PostcardID=" _ & RSID("PostCardID") Set objMail = CreateObject("CDONTS.NewMail") objMail.Send "info@rgstore.com", Request.Form("RecEmail"), _ "New Postcard for You", cstr(EmailMessage) Set objMail = Nothing TheMessage = "Postcard sent. You can now send another." else TheMessage = "Use this page to send a postcard to someone you know. " _ & "They will receive an email letting them know that they have a postcard to view." end if %>