<%@ LANGUAGE=VBSCRIPT %> <% Response.Expires = 0 %> <% 'Database Connection sname = Cstr(Request.ServerVariables("SERVER_NAME")) connStr = "" If InStr(1, sname, ".dev", vbTextCompare) <> 0 Then connStr = "DSN=EvokaReferral;UID=EvokaReferral;PWD=r3f3rth3mt0m3;" ElseIf InStr(1, sname, ".staging.", vbTextCompare) <> 0 Then connStr = "DSN=EvokaReferral;UID=EvokaReferral;PWD=r3f3rth3mt0m3;" Else connStr = "DSN=EvokaReferral;UID=EvokaReferral;PWD=r3f3rth3mt0m3;" End If sname = "" MAIL_SUBJECT = "FW: KU Connection - Issue 18, July 2003" NUM_FRIENDS = 4 CLIENT_ID = "kualumni" CAMPAIGN_ID = "july2003" CLIENT_NAME = "Kansas Alumni Association" ' Define Cuss words redim cussWords(74) cussWords(0) = "shit" cussWords(1) = "shits" cussWords(2) = "shittin" cussWords(3) = "shitting" cussWords(4) = "shitter" cussWords(5) = "fuck" cussWords(6) = "fuckin" cussWords(7) = "fucking" cussWords(8) = "fucker" cussWords(9) = "fuckers" cussWords(10) = "fucka" cussWords(11) = "fuckas" cussWords(12) = "cunt" cussWords(13) = "pussy" cussWords(14) = "cock" cussWords(15) = "dick" cussWords(16) = "slut" cussWords(17) = "asshole" cussWords(18) = "faggit" cussWords(19) = "faggot" cussWords(20) = "fag" cussWords(21) = "tit" cussWords(22) = "tits" cussWords(23) = "titty" cussWords(24) = "tittys" cussWords(25) = "titties" cussWords(26) = "goddamn" cussWords(27) = "nigger" cussWords(28) = "cocksucker" cussWords(29) = "cocksuckers" cussWords(30) = "cocksuckin" cussWords(31) = "cocksucking" cussWords(32) = "dicksucker" cussWords(33) = "dicksuckers" cussWords(34) = "dicksuckin" cussWords(35) = "dicksucking" cussWords(36) = "dickhead" cussWords(37) = "cockhead" cussWords(38) = "motherfucker" cussWords(39) = "motherfuckers" cussWords(40) = "muthafucka" cussWords(41) = "muthafuckas" cussWords(42) = "fags" cussWords(43) = "faggits" cussWords(44) = "faggots" cussWords(45) = "cocks" cussWords(46) = "dicks" cussWords(47) = "cunts" cussWords(48) = "pussys" cussWords(49) = "pussies" cussWords(50) = "assholes" cussWords(51) = "dickheads" cussWords(52) = "cockheads" cussWords(53) = "goddamnit" cussWords(54) = "niggers" cussWords(55) = "sluts" cussWords(56) = "twat" cussWords(57) = "twats" cussWords(58) = "shithead" cussWords(59) = "shitheads" cussWords(60) = "dickweed" cussWords(61) = "son of a bitch" cussWords(62) = "sonofabitch" cussWords(63) = "sonofbitches" cussWords(64) = "sons of bitches" cussWords(65) = "sunuvabitch" cussWords(66) = "sonuvabitch" cussWords(67) = "jack off" cussWords(68) = "jacks off" cussWords(69) = "jackin off" cussWords(70) = "jacking off" cussWords(71) = "jerk off" cussWords(72) = "jerks off" cussWords(73) = "jerkin off" cussWords(74) = "jerking off" select case (cstr(Request("cmd"))) case "process" errMsg = validateForm() If errMsg = "" Then process Else printForm End If case else: printForm end select function printForm () %> KU Connection :: Send to a Friend

   

Send KU Connection To A Friend

To send a version of the email you received to your friends, please complete the form below and click the 'Forward Email' button.

<% If errMsg <> "" Then %>
Error(s) occurred:
<%= errMsg %>
Please correct your entries and resubmit.
<% End If %>

" method="post" id=form1 name=form1>

From:

Your Email Address

Your Name

 

">

">

To:

Friend's Email Address

Friend's Name

Friend 1

">

">

Friend 2

">

">

Friend 3

">

">

Friend 4

">

">

 

 

 

Subject:

Note:

 

Contact Us | Privacy Policy | KU Home Page | Kansas Alumni Association
KU Endowment | KU Athletics | KU Bookstore

<% end function ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' function printThankYou () %> KU Connection ::  Issue 17, June 2003

 

Thanks for sharing KU Connection.
Return Home

 

Contact Us | Privacy Policy | KU Home Page | Kansas Alumni Association
KU Endowment | KU Athletics | KU Bookstore

<% end function ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' function process () ' Get the user info sender_fname = cstr(Request("sender_fname")) sender_lname = cstr(Request("sender_lname")) sender_email = cstr(Request("sender_email")) redim recip_fname(NUM_FRIENDS - 1) redim recip_lname(NUM_FRIENDS - 1) redim recip_email(NUM_FRIENDS - 1) for i = 0 to ubound(recip_fname) recip_fname(i) = cstr(Request("recip_fname_" & (i + 1))) recip_lname(i) = cstr(Request("recip_lname_" & (i + 1))) recip_email(i) = cstr(Request("recip_email_" & (i + 1))) next comment = cstr(Request("comment")) ' Strip out naughty language for i = 0 to ubound(cussWords) sender_fname = cstr(replace(sender_fname, cussWords(i), "", 1, -1, 1)) sender_lname = cstr(replace(sender_lname, cussWords(i), "", 1, -1, 1)) comment = cstr(replace(comment, cussWords(i), "", 1, -1, 1)) for j = 0 to ubound(recip_fname) recip_fname(j) = cstr(replace(recip_fname(j), cussWords(i), "", 1, -1, 1)) recip_lname(j) = cstr(replace(recip_lname(j), cussWords(i), "", 1, -1, 1)) next next '' Create some utility objects Set sql_obj = Server.CreateObject("LAFcommon.SQLUtil") Set html_obj = Server.CreateObject("LAFcommon.HTMLUtil") Set misc_obj = Server.CreateObject("LAFcommon.Misc") '' Connect to the database set connection = Server.CreateObject("ADODB.Connection") connection.Open connStr '' Get text and html templates htmlTemplate = "" textTemplate = "" ssql = "SELECT html_template, text_template " & _ "FROM Campaign WHERE Campaign.campaignid = '" & _ CAMPAIGN_ID & "'" Set rsTemp = connection.Execute(ssql) If Not rsTemp.EOF Then htmlTemplate = CStr(rsTemp("html_template")) textTemplate = CStr(rsTemp("text_template")) End If rsTemp.Close Set rsTemp = Nothing '' For each specified friend for i = 0 to ubound(recip_email) if (len(recip_email(i)) > 0) then '' Send the email username = sender_fname & " " & sender_lname friendname = recip_fname(i) & " " & recip_lname(i) Set smtpmail_obj = Server.CreateObject("LAFcommon.SMTPMail") smtpmail_obj.DeliveryMode = LAFCOMMON_SMTPMAIL_deliver_asynchronous smtpmail_obj.ReplyToAddress = sender_email smtpmail_obj.SenderAddress = "lafwebsite_sendtoafriend@lookandfeel.com" smtpmail_obj.SenderName = username smtpmail_obj.ServerName = "smtp-script.lookandfeel.com" smtpmail_obj.ServerPort = 25 If (smtpmail_obj.AddSection(LAFCOMMON_SMTPMAIL_plain_text_message, getTEXTContent(username, sender_email, friendname, recip_email(i), comment, textTemplate)) = LAFCOMMON_SMTPMAIL_success) Then If (smtpmail_obj.AddSection(LAFCOMMON_SMTPMAIL_html_text_message, getHTMLContent(username, sender_email, friendname, recip_email(i), comment, htmlTemplate, html_obj)) = LAFCOMMON_SMTPMAIL_success) Then smtpmail_obj.ProcessMessage recip_email(i), MAIL_SUBJECT, friendname & " <" & recip_email(i) & ">", sender_email End If End If set smtpmail_obj = nothing ' Insert the user info into the database ' Make sure we don't duplicate entries in Sender table senderid = getSenderId(sender_email, connection) If senderid = "" Then senderid = misc_obj.ShortGuidGen() connection.Execute _ "INSERT INTO Sender " & _ "(senderid, " & _ "firstname, " & _ "lastname, " & _ "email) " & _ "VALUES " & _ "('" & senderid & "', " & _ "'" & sql_obj.canonicalize(sender_fname) & "', " & _ "'" & sql_obj.canonicalize(sender_lname) & "', " & _ "'" & sql_obj.canonicalize(sender_email) & "')" End If connection.Execute _ "INSERT INTO Referral " & _ "(referralid, " & _ "senderid, " & _ "campaignid, " & _ "firstname, " & _ "lastname, " & _ "email, " & _ "comment) " & _ "VALUES " & _ "('" & misc_obj.ShortGuidGen() & "', " & _ "'" & senderid & "', " & _ "'" & sql_obj.canonicalize(CAMPAIGN_ID) & "', " & _ "'" & sql_obj.canonicalize(recip_fname(i)) & "', " & _ "'" & sql_obj.canonicalize(recip_lname(i)) & "', " & _ "'" & sql_obj.canonicalize(recip_email(i)) & "', " & _ "'" & sql_obj.canonicalize(comment) & "')" end if next '' Disconnect from the database connection.Close set connection = nothing '' deallocate utility objects Set sql_obj = nothing Set html_obj = nothing Set misc_obj = nothing ' That's it, we're done printThankYou end function ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' HTML Email ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' function getHTMLContent (username, useremail, friendname, friendemail, comment, template, html_obj) getHTMLContent = template getHTMLContent = replace(getHTMLContent, "[[username]]", html_obj.canonicalize(username), 1, -1, 1) getHTMLContent = replace(getHTMLContent, "[[useremail]]", html_obj.canonicalize(useremail), 1, -1, 1) getHTMLContent = replace(getHTMLContent, "[[friendname]]", html_obj.canonicalize(friendname), 1, -1, 1) getHTMLContent = replace(getHTMLContent, "[[friendemail]]", html_obj.canonicalize(friendemail), 1, -1, 1) getHTMLContent = replace(getHTMLContent, "[[comment]]", html_obj.canonicalize(comment), 1, -1, 1) end function ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Text Email ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' function getTEXTContent (username, useremail, friendname, friendemail, comment, template) getTEXTContent = template getTEXTContent = replace(getTEXTContent, "[[username]]", username, 1, -1, 1) getTEXTContent = replace(getTEXTContent, "[[useremail]]", useremail, 1, -1, 1) getTEXTContent = replace(getTEXTContent, "[[friendname]]", friendname, 1, -1, 1) getTEXTContent = replace(getTEXTContent, "[[friendemail]]", friendemail, 1, -1, 1) getTEXTContent = replace(getTEXTContent, "[[comment]]", comment, 1, -1, 1) end function ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' function getSenderId (senderemail, connection) getSenderId = "" ssql = "SELECT DISTINCT senderid FROM sender WHERE email = '" & senderemail & "'" Set rsSender = connection.Execute(ssql) If not rsSender.EOF Then getSenderId = CStr(rsSender("senderid")) End if rsSender.Close Set rsSender = nothing end function ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Validate Email Format ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Function validateEmail(emailAddress) validateEmail = false If Len(emailAddress) < 5 Then validateEmail = false Else Set regx_obj = New RegExp regx_obj.Pattern = "^[^\@]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]{2,6}$" regx_obj.IgnoreCase = true validateEmail = regx_obj.Test(emailAddress) Set regx_obj = nothing End If End Function ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Freinds Email Validation ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Function validateForm() validateForm = "" ' sendername entered If Len(CStr(Request("sender_fname"))) = 0 Then validateForm = validateForm & "You must enter your first and last name.
" End If ' senderemail valid sendermail = CStr(Request("sender_email")) If Len(sendermail) = 0 OR validateEmail(sendermail) = False Then validateForm = validateForm & "You must enter a valid email address for yourself.
" End If ' at least one recip_email entered ReDim recip(NUM_FRIENDS - 1) flag = 0 For kounter = 0 to UBound(recip) recip(kounter) = CStr(Request("recip_email_" & (kounter + 1))) If Len(recip(kounter)) > 0 Then flag = flag + 1 End If Next If flag = 0 Then validateForm = validateForm & "You must enter at least one message recipient.
" Else ' for each recip_email entered: ' - valid format ' - <> sender email ' - <> any succeeding emails ' - no previous email from sender to this recipient badflag = 0 selfflag = 0 spamflag = 0 oldspam = 0 For idx = 0 to UBound(recip) If Len(recip(idx)) > 0 Then If validateEmail(recip(idx)) = False Then badflag = badflag + 1 End If If Strcomp(recip(idx),sendermail,1) = 0 Then selfflag = selfflag + 1 End If For subdx = idx + 1 to UBound(recip) Step 1 If Len(recip(subdx)) > 0 AND Strcomp(recip(idx),recip(subdx),1) = 0 Then spamflag = + 1 End If Next ' query db Set con = Server.CreateObject("ADODB.Connection") con.Open(connStr) spamql = "SELECT COUNT(Referral.senderid) AS dups " & _ "FROM Referral INNER JOIN Sender ON " & _ "Sender.senderid = Referral.senderid " & _ "WHERE Sender.email = '" & sendermail & "' " & _ "AND Referral.campaignid = '" & CAMPAIGN_ID & "'" & _ "AND Referral.email IN (" For tidx = 0 to UBound(recip) spamql = spamql & "'" & recip(tidx) & "'" If tidx < UBound(recip) Then spamql = spamql & ", " End If Next spamql = spamql & ")" Set rspam = con.Execute(spamql) oldspam = CInt(rspam("dups")) rspam.close Set rspam = nothing con.Close Set con = nothing End If Next If badflag > 0 Then validateForm = validateForm & badflag & " invalid email addresses.
" End If If selfflag > 0 Then validateForm = validateForm & "Cannot send recommendation to your own email.
" End if If spamflag > 0 Then validateForm = validateForm & "Cannot have duplicate emails for recipients.
" End If If oldspam > 0 Then validateForm = validateForm & "You have already sent a recommendation to one or more friends listed.
" End If End If End Function %>