home *** CD-ROM | disk | FTP | other *** search
- <!--#include file="inccard.asp"-->
- <%
- ' First of all lets just get all variables
-
- Dim nCardId, sNameTo, sNameFrom, sEmailFrom, sText, sBGColor, sTextColor, sEmailTo
-
-
- nCardId = Request.Form("fldAuto")
- if nCardId = "" Then
- Response.Redirect "."
- End If
-
- 'Ok...
- sNameTo = Request.Form("nameto")
- sNameFrom = Request.Form("namefrom")
- sEmailFrom = Request.Form("emailfrom")
- sEmailTo = Request.Form("emailto")
- sGreeting = Request.Form("greeting")
- sText = Request.Form("S1")
- sBGColor = Request.Form("BgColor")
- sTextColor = Request.Form("TColor")
-
- 'Save it to database
- Dim oRS
- Set oConn = PostCard_GetDatabaseConn()
- oConn.Execute "update card set sendcount=sendcount+1 where fldAuto=" & nCardId
- Set oRS = Server.CreateObject("ADODB.Recordset")
- oRS.Open "select * from createdpostcards where fldAuto=-1 " ,oConn ,adOpenKeyset,adLockOptimistic
- oRS.AddNew
- oRS("cardid") = nCardId
- oRS("nameto") = sNameTo
- oRS("namefrom") = sNameFrom
- oRS("emailto") = sEmailTo
- oRS("emailfrom") = sEmailFrom
- oRS("greeting") = sGreeting
- oRS("stext") = sText
- oRS("bgcolor") = sBGColor
- oRS("textcolor") = sTextcolor
- oRS.Update
-
- Dim IDToSend
- IDToSend = oRS("fldAuto").Value
- oRS.Close
-
- set mailer = server.createobject("SMTPsvg.Mailer")
- Mailer.FromName = "PostcardService"
- Mailer.FromAddress = "postcardservice@aspcode.net"
- Mailer.RemoteHost = "mail.aspcode.net"
- Mailer.AddRecipient sNameTo, sEmailTo
- Mailer.Subject = sNameFrom & " has sent you a postcard"
-
- strMsgHeader = sNameFrom & "(" & sEmailFrom & ")" & " has sent you a postcard!" & vbCrLf
- strMsgHeader = "The address to pick it up is : " & GetPathToPickupScript() & "?cardid=" & IDToSend
- strMsgFooter = vbCrLf & vbCrLf & "This card was sent and created with the postcardservice at http://www.aspcode.net"
- Mailer.BodyText = strMsgHeader & strMsgFooter
-
- if Mailer.SendMail then
- ' Message sent Ok, redirect to a confirmation page
- Response.Redirect "thanks.asp"
- else
- ' Message send failure
- Response.Write ("An error has occurred.<BR>")
- ' Send error message
- Response.Write ("The error was " & Mailer.Response)
- end if
- %>
-
-
-
-
-
-
-
-
-