<%
End If
If Flag = 2 then
Randomize
apass = int(rnd*99999)+1
adags = now()
anafn1 = request.form("nafn1")
anetfang1 = request.form("netfang1")
anafn2 = request.form("nafn2")
anetfang2 = request.form("netfang2")
akvedja = request.form("kvedja")
afsogn = request.form("fsogn")
amynd = request.form("mynd")
set conn = server.createobject("adodb.connection")
DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; "
DSNtemp=dsntemp & "DBQ=" & server.mappath("kort.mdb")
conn.Open DSNtemp
SQLstmt = "INSERT INTO kort (pass,dags,nafn1,netfang1,nafn2,netfang2,kvedja,fsogn,mynd)"
SQLstmt = SQLstmt & " VALUES ("
SQLstmt = SQLstmt & "'" & apass & "',"
SQLstmt = SQLstmt & "'" & adags & "',"
SQLstmt = SQLstmt & "'" & anafn1 & "',"
SQLstmt = SQLstmt & "'" & anetfang1 & "',"
SQLstmt = SQLstmt & "'" & anafn2 & "',"
SQLstmt = SQLstmt & "'" & anetfang2 & "',"
SQLstmt = SQLstmt & "'" & akvedja & "',"
SQLstmt = SQLstmt & "'" & afsogn & "',"
SQLstmt = SQLstmt & "'" & amynd & "'"
SQLstmt = SQLstmt & ")"
Set RS = conn.execute(SQLstmt)
If err.number>0 then
response.write "VBScript error:" & ""
response.write "Number=" & err.number & "
"
response.write "Explanation.=" & err.description & "
"
response.write "Help Context=" & err.helpcontext & "
"
response.write "Help Path=" & err.helppath & "
"
response.write "Native Error=" & err.nativeerror & "
"
response.write "Source=" & err.source & "
"
response.write "SQLState=" & err.sqlstate & "
"
end if
IF conn.errors.count> 0 then
response.write "Access database error" & "
"
response.write SQLstmt & "
"
for counter= 0 to conn.errors.count
response.write "Error #" & conn.errors(counter).number & "
"
response.write "Explanation. -> " & conn.errors(counter).description & "
"
next
Conn.Close
set conn = nothing
else
Conn.Close
set conn = nothing
set conn = server.createobject("adodb.connection")
DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; "
DSNtemp=dsntemp & "DBQ=" & server.MapPath("kort.mdb")
conn.Open DSNtemp
sqlstmt = "SELECT * FROM kort WHERE nafn1 = "
sqlstmt = sqlstmt & "'" & anafn1 & "'"
sqlstmt = sqlstmt & " AND pass = "
sqlstmt = sqlstmt & apass
sqlstmt = sqlstmt & " ORDER BY id DESC;"
'rs.Open sqlstmt,conn,3,3
set rs = conn.Execute(sqlstmt)
id = rs("id")
Conn.Close
Set conn = nothing
dim mailbody
scriptname = Request.servervariables("script_name")
scriptname = Replace(scriptname,"greetings.asp","skoda.asp")
scriptname = "http://" & request.servervariables("server_name") & scriptname
mailbody = anafn2 & " has sent you a postcard" & Vbcrlf & vbcrlf
mailbody = mailbody & "You can pick your postcard up at the address :" & vbcrlf
mailbody = mailbody & ScriptName & "?id=" & id & "&pass=" & apass
mailbody = mailbody & vbcrlf & vbcrlf
mailbody = mailbody & "Or visit " & scriptname & vbcrlf
mailbody = mailbody & "And enter" & vbcrlf
mailbody = mailbody & "Postcard Id = " & id & vbcrlf
mailbody = mailbody & "Postcard Password = " & apass & vbCrlf & vbcrlf
blabla = "Thrissur Pooram greeting card from " & anafn2
'Response.Write mailbody
Name1 = Request.Form("Name")
Subject1 = Request.Form("Course_Applied")
Email1 = Request.Form("Email")
Dim mail
On Error Resume Next
Set mail = CreateObject("CDO.Message")
mail.From = "webmaster@thrissurpooram.com"
mail.To = anetfang1
'mail.Cc = "sreevivekananda.org"
mail.Bcc = "thrissurpooram@gmail.com;thrissurpooram@yahoo.com"
mail.Subject = blabla
mail.Htmlbody = mailbody
mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.radiomalayali.com"
mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = "1"
mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "webmaster@thrissurpooram.com"
mail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "+SaBX1)~TJ=~"
mail.Configuration.Fields.Update
mail.Send
If Not err.number=0 Then
Response.write "ERROR: " & err.Description
err.Clear
end if
%><
Thank you !!
Postcard has been sent to : <%= anafn1 %>
Sender is : <%= anafn2 %>
Back <%
end if
end if
%>