G
GTN170777
Hello Gurus/Experts,
I could do with a little ASP CDOSYS help please.
I have a page that accepts data from an external program, validates it and
then inserts the data into the database.
The same page then sends a confirmation email to the advertiser, and
following this identifies every subscriber with matching criteria and should
then send a HTML email notifying them of the post.
Then following this inserts a record consisting of AdvertiserID, Date,
Number of Subscribers (+More fields) in a different table.
However when i try and run the script I get the following error -
"Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'myMail.CreateHTMLBody'
/conkers/vacancypost3.asp, line 322"
Where line 322 is
myMail. CreateHTMLBody
"../jobseeker/afterregistration/vacancynotification.asp?ID=" &VACANCY("JBAID")
My entire script is below - Appreciate any help you can offer -
Many thanks GTN
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../Connections/recruta2.asp" -->
<!--#include file="../WA_DataAssist/WA_AppBuilder_VB.asp" -->
<%Session.Contents.Remove("SITEID")%>
<%Session.Contents.Remove("NEWVACANCY")%>
<%Session.Contents.Remove("NEWVACANCYCATEGORY")%>
<%Session.Contents.Remove("NEWVACANCYLOCATION")%>
<%Session.Contents.Remove("NEWVACANCYDESCRIPTION")%>
<%Session.Contents.Remove("CONKERSEMAIL")%>
<%Session.Contents.Remove("EMPLOYEENAME")%>
<%Session.Contents.Remove("EMPLOYEEUSERNAME")%>
<%Session.Contents.Remove("EMPLOYEEID")%>
<%Session.Contents.Remove("JBESENT")%>
<%Session("SITEID") = "30"%>
<%Session("NEWVACANCY") = Request.QueryString("jobtitle")%>
<%Session("NEWVACANCYCATEGORY") = Request.QueryString("Category")%>
<%Session("NEWVACANCYLOCATION") = Request.QueryString("Location")%>
<%Session("NEWVACANCYDESCRIPTION") = Request.QueryString("jobdescription")%>
<%Session("CONKERSEMAIL") = Request.QueryString("conkeremail")%>
<%
Dim username__MMColParam
username__MMColParam = "%"
If (Request.QueryString("username") <> "") Then
username__MMColParam = Request.QueryString("username")
End If
%>
<%
Dim username__MMColParam2
username__MMColParam2 = "%"
If (Request.QueryString("password") <> "") Then
username__MMColParam2 = Request.QueryString("password")
End If
%>
<%
Dim username__MMColParam3
username__MMColParam3 = "30"
If (Session("SITEID") <> "") Then
username__MMColParam3 = Session("SITEID")
End If
%>
<%
Dim username
Dim username_cmd
Dim username_numRows
Set username_cmd = Server.CreateObject ("ADODB.Command")
username_cmd.ActiveConnection = MM_recruta2_STRING
username_cmd.CommandText = "SELECT JBEUsername, JBEName, JBEID FROM
dbo.JBEmployee WHERE JBEUsername = ? AND JBEPassword = ? AND JBESiteID = ?"
username_cmd.Prepared = true
username_cmd.Parameters.Append username_cmd.CreateParameter("param1", 200,
1, 255, username__MMColParam) ' adVarChar
username_cmd.Parameters.Append username_cmd.CreateParameter("param2", 200,
1, 255, username__MMColParam2) ' adVarChar
username_cmd.Parameters.Append username_cmd.CreateParameter("param3", 5, 1,
-1, username__MMColParam3) ' adDouble
Set username = username_cmd.Execute
username_numRows = 0
%>
<%Session("EMPLOYEENAME") = username.Fields.Item("JBEName").Value%>
<%Session("EMPLOYEEUSERNAME") = username.Fields.Item("JBEUsername").Value%>
<%Session("EMPLOYEEID") = username.Fields.Item("JBEID").Value%>
<%
Dim Conkers__username
Conkers__username = "0"
if(Request.QueryString("username") <> "") then Conkers__username =
Request.QueryString("username")
Dim Conkers__password
Conkers__password = "0"
if(Request.QueryString("password") <> "") then Conkers__password =
Request.QueryString("password")
Dim Conkers__siteid
Conkers__siteid = "0"
if(Session("SITEID") <> "") then Conkers__siteid = Session("SITEID")
Dim Conkers__jobtitle
Conkers__jobtitle = "0"
if(Request.QueryString("jobtitle") <> "") then Conkers__jobtitle =
Request.QueryString("jobtitle")
Dim Conkers__jobdescription
Conkers__jobdescription = "0"
if(Request.QueryString("jobdescription") <> "") then Conkers__jobdescription
= Server.HTMLEncode(Request.QueryString("jobdescription"))
Dim Conkers__Payrate
Conkers__Payrate = "0"
if(Request.QueryString("Payrate") <> "") then Conkers__Payrate =
Server.HTMLEncode(Request.QueryString("Payrate"))
Dim Conkers__Location
Conkers__Location = "0"
if(Request.QueryString("Location") <> "") then Conkers__Location =
Request.QueryString("Location")
Dim Conkers__Category
Conkers__Category = "0"
if(Request.QueryString("Category") <> "") then Conkers__Category =
Request.QueryString("Category")
Dim Conkers__JonType
Conkers__JonType = "0"
if(Request.QueryString("JonType") <> "") then Conkers__JonType =
Request.QueryString("JonType")
Dim Conkers__reference
Conkers__reference = "0"
if(Request.QueryString("reference") <> "") then Conkers__reference =
Request.QueryString("reference")
Dim Conkers__startdate
Conkers__startdate = "0"
if(Request.QueryString("startdate") <> "") then Conkers__startdate =
Request.QueryString("startdate")
Dim Conkers__conkeremai
Conkers__conkeremai = "0"
if(Request.QueryString("conkeremail") <> "") then Conkers__conkeremai =
Request.QueryString("conkeremail")
%>
<%
set Conkers = Server.CreateObject("ADODB.Command")
Conkers.ActiveConnection = MM_recruta2_STRING
Conkers.CommandText = "dbo.conker"
Conkers.CommandType = 4
Conkers.CommandTimeout = 0
Conkers.Prepared = true
Conkers.Parameters.Append Conkers.CreateParameter("@RETURN_VALUE", 3, 4)
Conkers.Parameters.Append Conkers.CreateParameter("@username", 200,
1,225,Conkers__username)
Conkers.Parameters.Append Conkers.CreateParameter("@password", 200,
1,50,Conkers__password)
Conkers.Parameters.Append Conkers.CreateParameter("@siteid", 3,
1,5,Conkers__siteid)
Conkers.Parameters.Append Conkers.CreateParameter("@jobtitle", 200,
1,50,Conkers__jobtitle)
Conkers.Parameters.Append Conkers.CreateParameter("@jobdescription", 200,
1,4000,Conkers__jobdescription)
Conkers.Parameters.Append Conkers.CreateParameter("@Payrate", 200,
1,250,Conkers__Payrate)
Conkers.Parameters.Append Conkers.CreateParameter("@Location", 200,
1,50,Conkers__Location)
Conkers.Parameters.Append Conkers.CreateParameter("@Category", 200,
1,50,Conkers__Category)
Conkers.Parameters.Append Conkers.CreateParameter("@JonType", 200,
1,50,Conkers__JonType)
Conkers.Parameters.Append Conkers.CreateParameter("@reference", 200,
1,50,Conkers__reference)
Conkers.Parameters.Append Conkers.CreateParameter("@startdate", 200,
1,50,Conkers__startdate)
Conkers.Parameters.Append Conkers.CreateParameter("@conkeremai", 200,
1,225,Conkers__conkeremai)
Conkers.Execute()
%>
<%
Dim jbeusers__MMColParam
jbeusers__MMColParam = "0"
If (Session("SITEID") <> "") Then
jbeusers__MMColParam = Session("SITEID")
End If
%>
<%
Dim jbeusers__MMColParam2
jbeusers__MMColParam2 = "%"
If (Session("NEWVACANCYLOCATION") <> "") Then
jbeusers__MMColParam2 = Session("NEWVACANCYLOCATION")
End If
%>
<%
Dim jbeusers__MMColParam3
jbeusers__MMColParam3 = "%"
If (Session("NEWVACANCYCATEGORY") <> "") Then
jbeusers__MMColParam3 = Session("NEWVACANCYCATEGORY")
End If
%>
<%
Dim jbeusers__MMColParam4
jbeusers__MMColParam4 = "%"
If (Session("NEWVACANCYDESCRIPTION") <> "") Then
jbeusers__MMColParam4 = Session("NEWVACANCYDESCRIPTION")
End If
%>
<%
Dim jbeusers
Dim jbeusers_cmd
Dim jbeusers_numRows
Set jbeusers_cmd = Server.CreateObject ("ADODB.Command")
jbeusers_cmd.ActiveConnection = MM_recruta2_STRING
jbeusers_cmd.CommandText = "SELECT * FROM dbo.JBEmailNotification WHERE
JBENsiteID = ? AND JBENlocation = ? AND JBENcategory = ? AND ? like '%' +
JBENKeyword + '%'"
jbeusers_cmd.Prepared = true
jbeusers_cmd.Parameters.Append jbeusers_cmd.CreateParameter("param1", 5, 1,
-1, jbeusers__MMColParam) ' adDouble
jbeusers_cmd.Parameters.Append jbeusers_cmd.CreateParameter("param2", 200,
1, 255, jbeusers__MMColParam2) ' adVarChar
jbeusers_cmd.Parameters.Append jbeusers_cmd.CreateParameter("param3", 200,
1, 255, jbeusers__MMColParam3) ' adVarChar
jbeusers_cmd.Parameters.Append jbeusers_cmd.CreateParameter("param4", 200,
1, 4000, jbeusers__MMColParam4) ' adVarChar
Set jbeusers = jbeusers_cmd.Execute
jbeusers_numRows = 0
%>
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "0"
If (Session("SITEID") <> "") Then
Recordset1__MMColParam = Session("SITEID")
End If
%>
<%
Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows
Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1_cmd.ActiveConnection = MM_recruta2_STRING
Recordset1_cmd.CommandText = "SELECT JBSSiteID, JBSMetaTitle, JBSLogo,
JBSMetaKeywords, JBSMetaDescription, JBSHomePageText, JBSURL, JBSURLShort,
JBSNoReplyEmail FROM dbo.JBSite WHERE JBSSiteID = ?"
Recordset1_cmd.Prepared = true
Recordset1_cmd.Parameters.Append Recordset1_cmd.CreateParameter("param1", 5,
1, -1, Recordset1__MMColParam) ' adDouble
Set Recordset1 = Recordset1_cmd.Execute
Recordset1_numRows = 0
%>
<%
Dim USERS__MMColParam
USERS__MMColParam = "0"
If (Session("SITEID") <> "") Then
USERS__MMColParam = Session("SITEID")
End If
%>
<%
Dim USERS__MMColParam2
USERS__MMColParam2 = "%"
If (Session("NEWVACANCYLOCATION") <> "") Then
USERS__MMColParam2 = Session("NEWVACANCYLOCATION")
End If
%>
<%
Dim USERS__MMColParam3
USERS__MMColParam3 = "%"
If (Session("NEWVACANCYCATEGORY") <> "") Then
USERS__MMColParam3 = Session("NEWVACANCYCATEGORY")
End If
%>
<%
Dim USERS__MMColParam4
USERS__MMColParam4 = "%"
If (Session("NEWVACANCYDESCRIPTION") <> "") Then
USERS__MMColParam4 = Session("NEWVACANCYDESCRIPTION")
End If
%>
<%
Dim USERS
Dim USERS_cmd
Dim USERS_numRows
Set USERS_cmd = Server.CreateObject ("ADODB.Command")
USERS_cmd.ActiveConnection = MM_recruta2_STRING
USERS_cmd.CommandText = "SELECT COUNT(JBENusername) As USERS FROM
dbo.JBEmailNotification WHERE JBENsiteID = ? AND JBENlocation = ? AND
JBENcategory = ? AND ? like '%' + JBENKeyword + '%'"
USERS_cmd.Prepared = true
USERS_cmd.Parameters.Append USERS_cmd.CreateParameter("param1", 5, 1, -1,
USERS__MMColParam) ' adDouble
USERS_cmd.Parameters.Append USERS_cmd.CreateParameter("param2", 200, 1, 255,
USERS__MMColParam2) ' adVarChar
USERS_cmd.Parameters.Append USERS_cmd.CreateParameter("param3", 200, 1, 255,
USERS__MMColParam3) ' adVarChar
USERS_cmd.Parameters.Append USERS_cmd.CreateParameter("param4", 200, 1,
4000, USERS__MMColParam4) ' adVarChar
Set USERS = USERS_cmd.Execute
USERS_numRows = 0
%>
<%
Dim VACANCY__MMColParam
VACANCY__MMColParam = "0"
If (Session("NEWVACANCY") <> "") Then
VACANCY__MMColParam = Session("NEWVACANCY")
End If
%>
<%
Dim VACANCY__MMColParam2
VACANCY__MMColParam2 = "0"
If (Session("EMPLOYEEID") <> "") Then
VACANCY__MMColParam2 = Session("EMPLOYEEID")
End If
%><%
Dim VACANCY__MMColParam3
VACANCY__MMColParam3 = "0"
If (Session("SITEID") <> "") Then
VACANCY__MMColParam3 = Session("SITEID")
End If
%><%
Dim VACANCY
Dim VACANCY_cmd
Dim VACANCY_numRows
Set VACANCY_cmd = Server.CreateObject ("ADODB.Command")
VACANCY_cmd.ActiveConnection = MM_recruta2_STRING
VACANCY_cmd.CommandText = "SELECT JBAID, JBAEmployeeID, JBASiteID, JBATitle,
JBADatePosted, JBADescription, JBAPayRate, JBALocation, JBAEmplymentType,
JBAReference, JBAConkersEmail FROM dbo.JBAdvert WHERE JBATitle = ? AND
JBAEmployeeID = ? AND JBASiteID = ? AND JBADatePosted BETWEEN DATEADD(mi, -3,
GETDATE()) AND GETDATE()"
VACANCY_cmd.Prepared = true
VACANCY_cmd.Parameters.Append VACANCY_cmd.CreateParameter("param1", 200, 1,
255, VACANCY__MMColParam) ' adVarChar
VACANCY_cmd.Parameters.Append VACANCY_cmd.CreateParameter("param2", 5, 1,
-1, VACANCY__MMColParam2) ' adDouble
VACANCY_cmd.Parameters.Append VACANCY_cmd.CreateParameter("param3", 5, 1,
-1, VACANCY__MMColParam3) ' adDouble
Set VACANCY = VACANCY_cmd.Execute
VACANCY_numRows = 0
%>
<%Session("JBESENT") = (USERS.Fields.Item("USERS").Value)%>
<%
Dim ObjSendMail
Dim iConf
Dim Flds
Set ObjSendMail = Server.CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") =
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:\inetpub\mailroot\pickup"
Flds.Update
EmployeeName=(Session("EMPLOYEENAME"))
strVacancy=(VACANCY("JBATitle"))
URLShort=(Recordset1("JBSURLShort"))
ReplyMail=(Recordset1("JBSNoReplyEmail"))
ConkerEmail=(VACANCY("JBAConkersEmail"))
RecEmail=(username("JBEUsername"))
Set ObjSendMail.Configuration = iConf
ObjSendMail.To = RECEmail
ObjSendMail.Subject = "Job Advert " & strVacancy & " posted on " & URLShort
ObjSendMail.From = ReplyMail
if VACANCY("JBAConkersEmail")="" then
ObjSendMail.Bcc = ConkerEmail
else
end if
ObjSendMail.ReplyTo = APEmail
ObjSendMail.TextBody = "Dear " & EmployeeName & "," & vbCRLF & "" & vbCRLF &
"Your vacancy titled " & strVacancy & " has successfully been posted on " &
URLShort & "" & vbCRLF & "" & vbCRLF & "Kind regards"
ObjSendMail.Send
Set ObjSendMail = Nothing
%>
<%
if not jbeusers.eof then
do while not jbeusers.eof
Set myMail=CreateObject("CDO.Message")
strVacancy=(VACANCY("JBATitle"))
URLShort=(Recordset1("JBSURLShort"))
ReplyMail=(Recordset1("JBSNoReplyEmail"))
myMail.Subject= "Job Advert " & strVacancy & " advertised on " & URLShort
myMail.From= ReplyMail
myMail.To= ""& jbeusers("JBENusername")&"; "
myMail. CreateHTMLBody
"../jobseeker/afterregistration/vacancynotification.asp?ID=" &VACANCY("JBAID")
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver")="smtp.domain.com"
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing
jbeusers.MoveNext
Loop
Set jbeusers = nothing
objConn.close
end if
%>
<%
' WA Application Builder Insert
if ("" = "") then
WA_connection = MM_recruta2_STRING
WA_table = "dbo.JBESent"
WA_sessionName = "JBESent_JBESID"
WA_redirectURL = "success.asp"
WA_keepQueryString = false
WA_indexField = "JBESID"
WA_fieldNamesStr =
"JBESSiteID|JBESJobID|JBESLocation|JBESCategory|JBESReceipients"
WA_fieldValuesStr = "" & cStr( Session("SITEID") ) & "" & "|" & "" &
cStr((VACANCY.Fields.Item("JBAID").Value)) & "" & "|" & "" & cStr(
Session("NEWVACANCYLOCATION") ) & "" & "|" & "" & cStr(
Session("NEWVACANCYCATEGORY") ) & "" & "|" & "" & cStr( Session("JBESENT") )
& ""
WA_columnTypesStr =
"none,none,NULL|none,none,NULL|',none,''|',none,''|none,none,NULL"
WA_comparisonStr = " = | = | LIKE | LIKE | = "
WA_fieldNames = Split(WA_fieldNamesStr,"|")
WA_fieldValues = Split(WA_fieldValuesStr,"|")
WA_columns = Split(WA_columnTypesStr,"|")
WA_comparisions = Split(WA_comparisonStr, "|")
insertParamsObj = WA_AB_generateInsertParams(WA_fieldNames, WA_columns,
WA_fieldValues, -1)
set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = WA_connection
MM_editCmd.CommandText = "INSERT INTO " & WA_table & " (" &
insertParamsObj(1) & ") VALUES (" & insertParamsObj(2) & ")"
MM_editCmd.Execute()
MM_editCmd.ActiveConnection.Close()
obj = WA_AB_generateWhereClause(WA_fieldNames, WA_columns, WA_fieldValues,
WA_comparisions)
sqlstr = "SELECT " & WA_indexField & " FROM " & WA_table & " WHERE " &
obj & " ORDER BY " & WA_indexField & " DESC"
set WA_AppBuilderRecordset = Server.CreateObject("ADODB.Recordset")
WA_AppBuilderRecordset.ActiveConnection = WA_connection
WA_AppBuilderRecordset.Source = sqlstr
WA_AppBuilderRecordset.CursorType = 0
WA_AppBuilderRecordset.CursorLocation = 2
WA_AppBuilderRecordset.LockType = 1
WA_AppBuilderRecordset.Open()
if (NOT WA_AppBuilderRecordset.EOF) then Session(WA_sessionName) =
WA_AppBuilderRecordset.Fields.Item(WA_indexField).Value
WA_AppBuilderRecordset.Close()
if (WA_redirectURL <> "") then
if (WA_keepQueryString AND Request.QueryString <> "" AND
Request.QueryString.Count > 0) then
if (inStr(WA_redirectURL,"?") > 0) then
WA_redirectURL = WA_redirectURL & "&"
else
WA_redirectURL = WA_redirectURL & "?"
end if
WA_redirectURL = WA_redirectURL & Request.QueryString
end if
Response.Redirect(WA_redirectURL)
end if
end if
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
If (jbeusers_total = -1) Then
' count the total records by iterating through the recordset
jbeusers_total=0
While (Not jbeusers.EOF)
jbeusers_total = jbeusers_total + 1
jbeusers.MoveNext
Wend
' reset the cursor to the beginning
If (jbeusers.CursorType > 0) Then
jbeusers.MoveFirst
Else
jbeusers.Requery
End If
' set the number of rows displayed on this page
If (jbeusers_numRows < 0 Or jbeusers_numRows > jbeusers_total) Then
jbeusers_numRows = jbeusers_total
End If
' set the first and last displayed record
jbeusers_first = 1
jbeusers_last = jbeusers_first + jbeusers_numRows - 1
If (jbeusers_first > jbeusers_total) Then
jbeusers_first = jbeusers_total
End If
If (jbeusers_last > jbeusers_total) Then
jbeusers_last = jbeusers_total
End If
End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>vacancypost</title>
<meta name="Robots" content="noindex,nofollow" />
</head>
<body>
</body>
</html>
<%
username.Close()
Set username = Nothing
%>
<%
jbeusers.Close()
Set jbeusers = Nothing
%>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
<%
USERS.Close()
Set USERS = Nothing
%><%
VACANCY.Close()
Set VACANCY = Nothing
%>
I could do with a little ASP CDOSYS help please.
I have a page that accepts data from an external program, validates it and
then inserts the data into the database.
The same page then sends a confirmation email to the advertiser, and
following this identifies every subscriber with matching criteria and should
then send a HTML email notifying them of the post.
Then following this inserts a record consisting of AdvertiserID, Date,
Number of Subscribers (+More fields) in a different table.
However when i try and run the script I get the following error -
"Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'myMail.CreateHTMLBody'
/conkers/vacancypost3.asp, line 322"
Where line 322 is
myMail. CreateHTMLBody
"../jobseeker/afterregistration/vacancynotification.asp?ID=" &VACANCY("JBAID")
My entire script is below - Appreciate any help you can offer -
Many thanks GTN
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../Connections/recruta2.asp" -->
<!--#include file="../WA_DataAssist/WA_AppBuilder_VB.asp" -->
<%Session.Contents.Remove("SITEID")%>
<%Session.Contents.Remove("NEWVACANCY")%>
<%Session.Contents.Remove("NEWVACANCYCATEGORY")%>
<%Session.Contents.Remove("NEWVACANCYLOCATION")%>
<%Session.Contents.Remove("NEWVACANCYDESCRIPTION")%>
<%Session.Contents.Remove("CONKERSEMAIL")%>
<%Session.Contents.Remove("EMPLOYEENAME")%>
<%Session.Contents.Remove("EMPLOYEEUSERNAME")%>
<%Session.Contents.Remove("EMPLOYEEID")%>
<%Session.Contents.Remove("JBESENT")%>
<%Session("SITEID") = "30"%>
<%Session("NEWVACANCY") = Request.QueryString("jobtitle")%>
<%Session("NEWVACANCYCATEGORY") = Request.QueryString("Category")%>
<%Session("NEWVACANCYLOCATION") = Request.QueryString("Location")%>
<%Session("NEWVACANCYDESCRIPTION") = Request.QueryString("jobdescription")%>
<%Session("CONKERSEMAIL") = Request.QueryString("conkeremail")%>
<%
Dim username__MMColParam
username__MMColParam = "%"
If (Request.QueryString("username") <> "") Then
username__MMColParam = Request.QueryString("username")
End If
%>
<%
Dim username__MMColParam2
username__MMColParam2 = "%"
If (Request.QueryString("password") <> "") Then
username__MMColParam2 = Request.QueryString("password")
End If
%>
<%
Dim username__MMColParam3
username__MMColParam3 = "30"
If (Session("SITEID") <> "") Then
username__MMColParam3 = Session("SITEID")
End If
%>
<%
Dim username
Dim username_cmd
Dim username_numRows
Set username_cmd = Server.CreateObject ("ADODB.Command")
username_cmd.ActiveConnection = MM_recruta2_STRING
username_cmd.CommandText = "SELECT JBEUsername, JBEName, JBEID FROM
dbo.JBEmployee WHERE JBEUsername = ? AND JBEPassword = ? AND JBESiteID = ?"
username_cmd.Prepared = true
username_cmd.Parameters.Append username_cmd.CreateParameter("param1", 200,
1, 255, username__MMColParam) ' adVarChar
username_cmd.Parameters.Append username_cmd.CreateParameter("param2", 200,
1, 255, username__MMColParam2) ' adVarChar
username_cmd.Parameters.Append username_cmd.CreateParameter("param3", 5, 1,
-1, username__MMColParam3) ' adDouble
Set username = username_cmd.Execute
username_numRows = 0
%>
<%Session("EMPLOYEENAME") = username.Fields.Item("JBEName").Value%>
<%Session("EMPLOYEEUSERNAME") = username.Fields.Item("JBEUsername").Value%>
<%Session("EMPLOYEEID") = username.Fields.Item("JBEID").Value%>
<%
Dim Conkers__username
Conkers__username = "0"
if(Request.QueryString("username") <> "") then Conkers__username =
Request.QueryString("username")
Dim Conkers__password
Conkers__password = "0"
if(Request.QueryString("password") <> "") then Conkers__password =
Request.QueryString("password")
Dim Conkers__siteid
Conkers__siteid = "0"
if(Session("SITEID") <> "") then Conkers__siteid = Session("SITEID")
Dim Conkers__jobtitle
Conkers__jobtitle = "0"
if(Request.QueryString("jobtitle") <> "") then Conkers__jobtitle =
Request.QueryString("jobtitle")
Dim Conkers__jobdescription
Conkers__jobdescription = "0"
if(Request.QueryString("jobdescription") <> "") then Conkers__jobdescription
= Server.HTMLEncode(Request.QueryString("jobdescription"))
Dim Conkers__Payrate
Conkers__Payrate = "0"
if(Request.QueryString("Payrate") <> "") then Conkers__Payrate =
Server.HTMLEncode(Request.QueryString("Payrate"))
Dim Conkers__Location
Conkers__Location = "0"
if(Request.QueryString("Location") <> "") then Conkers__Location =
Request.QueryString("Location")
Dim Conkers__Category
Conkers__Category = "0"
if(Request.QueryString("Category") <> "") then Conkers__Category =
Request.QueryString("Category")
Dim Conkers__JonType
Conkers__JonType = "0"
if(Request.QueryString("JonType") <> "") then Conkers__JonType =
Request.QueryString("JonType")
Dim Conkers__reference
Conkers__reference = "0"
if(Request.QueryString("reference") <> "") then Conkers__reference =
Request.QueryString("reference")
Dim Conkers__startdate
Conkers__startdate = "0"
if(Request.QueryString("startdate") <> "") then Conkers__startdate =
Request.QueryString("startdate")
Dim Conkers__conkeremai
Conkers__conkeremai = "0"
if(Request.QueryString("conkeremail") <> "") then Conkers__conkeremai =
Request.QueryString("conkeremail")
%>
<%
set Conkers = Server.CreateObject("ADODB.Command")
Conkers.ActiveConnection = MM_recruta2_STRING
Conkers.CommandText = "dbo.conker"
Conkers.CommandType = 4
Conkers.CommandTimeout = 0
Conkers.Prepared = true
Conkers.Parameters.Append Conkers.CreateParameter("@RETURN_VALUE", 3, 4)
Conkers.Parameters.Append Conkers.CreateParameter("@username", 200,
1,225,Conkers__username)
Conkers.Parameters.Append Conkers.CreateParameter("@password", 200,
1,50,Conkers__password)
Conkers.Parameters.Append Conkers.CreateParameter("@siteid", 3,
1,5,Conkers__siteid)
Conkers.Parameters.Append Conkers.CreateParameter("@jobtitle", 200,
1,50,Conkers__jobtitle)
Conkers.Parameters.Append Conkers.CreateParameter("@jobdescription", 200,
1,4000,Conkers__jobdescription)
Conkers.Parameters.Append Conkers.CreateParameter("@Payrate", 200,
1,250,Conkers__Payrate)
Conkers.Parameters.Append Conkers.CreateParameter("@Location", 200,
1,50,Conkers__Location)
Conkers.Parameters.Append Conkers.CreateParameter("@Category", 200,
1,50,Conkers__Category)
Conkers.Parameters.Append Conkers.CreateParameter("@JonType", 200,
1,50,Conkers__JonType)
Conkers.Parameters.Append Conkers.CreateParameter("@reference", 200,
1,50,Conkers__reference)
Conkers.Parameters.Append Conkers.CreateParameter("@startdate", 200,
1,50,Conkers__startdate)
Conkers.Parameters.Append Conkers.CreateParameter("@conkeremai", 200,
1,225,Conkers__conkeremai)
Conkers.Execute()
%>
<%
Dim jbeusers__MMColParam
jbeusers__MMColParam = "0"
If (Session("SITEID") <> "") Then
jbeusers__MMColParam = Session("SITEID")
End If
%>
<%
Dim jbeusers__MMColParam2
jbeusers__MMColParam2 = "%"
If (Session("NEWVACANCYLOCATION") <> "") Then
jbeusers__MMColParam2 = Session("NEWVACANCYLOCATION")
End If
%>
<%
Dim jbeusers__MMColParam3
jbeusers__MMColParam3 = "%"
If (Session("NEWVACANCYCATEGORY") <> "") Then
jbeusers__MMColParam3 = Session("NEWVACANCYCATEGORY")
End If
%>
<%
Dim jbeusers__MMColParam4
jbeusers__MMColParam4 = "%"
If (Session("NEWVACANCYDESCRIPTION") <> "") Then
jbeusers__MMColParam4 = Session("NEWVACANCYDESCRIPTION")
End If
%>
<%
Dim jbeusers
Dim jbeusers_cmd
Dim jbeusers_numRows
Set jbeusers_cmd = Server.CreateObject ("ADODB.Command")
jbeusers_cmd.ActiveConnection = MM_recruta2_STRING
jbeusers_cmd.CommandText = "SELECT * FROM dbo.JBEmailNotification WHERE
JBENsiteID = ? AND JBENlocation = ? AND JBENcategory = ? AND ? like '%' +
JBENKeyword + '%'"
jbeusers_cmd.Prepared = true
jbeusers_cmd.Parameters.Append jbeusers_cmd.CreateParameter("param1", 5, 1,
-1, jbeusers__MMColParam) ' adDouble
jbeusers_cmd.Parameters.Append jbeusers_cmd.CreateParameter("param2", 200,
1, 255, jbeusers__MMColParam2) ' adVarChar
jbeusers_cmd.Parameters.Append jbeusers_cmd.CreateParameter("param3", 200,
1, 255, jbeusers__MMColParam3) ' adVarChar
jbeusers_cmd.Parameters.Append jbeusers_cmd.CreateParameter("param4", 200,
1, 4000, jbeusers__MMColParam4) ' adVarChar
Set jbeusers = jbeusers_cmd.Execute
jbeusers_numRows = 0
%>
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "0"
If (Session("SITEID") <> "") Then
Recordset1__MMColParam = Session("SITEID")
End If
%>
<%
Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows
Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1_cmd.ActiveConnection = MM_recruta2_STRING
Recordset1_cmd.CommandText = "SELECT JBSSiteID, JBSMetaTitle, JBSLogo,
JBSMetaKeywords, JBSMetaDescription, JBSHomePageText, JBSURL, JBSURLShort,
JBSNoReplyEmail FROM dbo.JBSite WHERE JBSSiteID = ?"
Recordset1_cmd.Prepared = true
Recordset1_cmd.Parameters.Append Recordset1_cmd.CreateParameter("param1", 5,
1, -1, Recordset1__MMColParam) ' adDouble
Set Recordset1 = Recordset1_cmd.Execute
Recordset1_numRows = 0
%>
<%
Dim USERS__MMColParam
USERS__MMColParam = "0"
If (Session("SITEID") <> "") Then
USERS__MMColParam = Session("SITEID")
End If
%>
<%
Dim USERS__MMColParam2
USERS__MMColParam2 = "%"
If (Session("NEWVACANCYLOCATION") <> "") Then
USERS__MMColParam2 = Session("NEWVACANCYLOCATION")
End If
%>
<%
Dim USERS__MMColParam3
USERS__MMColParam3 = "%"
If (Session("NEWVACANCYCATEGORY") <> "") Then
USERS__MMColParam3 = Session("NEWVACANCYCATEGORY")
End If
%>
<%
Dim USERS__MMColParam4
USERS__MMColParam4 = "%"
If (Session("NEWVACANCYDESCRIPTION") <> "") Then
USERS__MMColParam4 = Session("NEWVACANCYDESCRIPTION")
End If
%>
<%
Dim USERS
Dim USERS_cmd
Dim USERS_numRows
Set USERS_cmd = Server.CreateObject ("ADODB.Command")
USERS_cmd.ActiveConnection = MM_recruta2_STRING
USERS_cmd.CommandText = "SELECT COUNT(JBENusername) As USERS FROM
dbo.JBEmailNotification WHERE JBENsiteID = ? AND JBENlocation = ? AND
JBENcategory = ? AND ? like '%' + JBENKeyword + '%'"
USERS_cmd.Prepared = true
USERS_cmd.Parameters.Append USERS_cmd.CreateParameter("param1", 5, 1, -1,
USERS__MMColParam) ' adDouble
USERS_cmd.Parameters.Append USERS_cmd.CreateParameter("param2", 200, 1, 255,
USERS__MMColParam2) ' adVarChar
USERS_cmd.Parameters.Append USERS_cmd.CreateParameter("param3", 200, 1, 255,
USERS__MMColParam3) ' adVarChar
USERS_cmd.Parameters.Append USERS_cmd.CreateParameter("param4", 200, 1,
4000, USERS__MMColParam4) ' adVarChar
Set USERS = USERS_cmd.Execute
USERS_numRows = 0
%>
<%
Dim VACANCY__MMColParam
VACANCY__MMColParam = "0"
If (Session("NEWVACANCY") <> "") Then
VACANCY__MMColParam = Session("NEWVACANCY")
End If
%>
<%
Dim VACANCY__MMColParam2
VACANCY__MMColParam2 = "0"
If (Session("EMPLOYEEID") <> "") Then
VACANCY__MMColParam2 = Session("EMPLOYEEID")
End If
%><%
Dim VACANCY__MMColParam3
VACANCY__MMColParam3 = "0"
If (Session("SITEID") <> "") Then
VACANCY__MMColParam3 = Session("SITEID")
End If
%><%
Dim VACANCY
Dim VACANCY_cmd
Dim VACANCY_numRows
Set VACANCY_cmd = Server.CreateObject ("ADODB.Command")
VACANCY_cmd.ActiveConnection = MM_recruta2_STRING
VACANCY_cmd.CommandText = "SELECT JBAID, JBAEmployeeID, JBASiteID, JBATitle,
JBADatePosted, JBADescription, JBAPayRate, JBALocation, JBAEmplymentType,
JBAReference, JBAConkersEmail FROM dbo.JBAdvert WHERE JBATitle = ? AND
JBAEmployeeID = ? AND JBASiteID = ? AND JBADatePosted BETWEEN DATEADD(mi, -3,
GETDATE()) AND GETDATE()"
VACANCY_cmd.Prepared = true
VACANCY_cmd.Parameters.Append VACANCY_cmd.CreateParameter("param1", 200, 1,
255, VACANCY__MMColParam) ' adVarChar
VACANCY_cmd.Parameters.Append VACANCY_cmd.CreateParameter("param2", 5, 1,
-1, VACANCY__MMColParam2) ' adDouble
VACANCY_cmd.Parameters.Append VACANCY_cmd.CreateParameter("param3", 5, 1,
-1, VACANCY__MMColParam3) ' adDouble
Set VACANCY = VACANCY_cmd.Execute
VACANCY_numRows = 0
%>
<%Session("JBESENT") = (USERS.Fields.Item("USERS").Value)%>
<%
Dim ObjSendMail
Dim iConf
Dim Flds
Set ObjSendMail = Server.CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") =
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:\inetpub\mailroot\pickup"
Flds.Update
EmployeeName=(Session("EMPLOYEENAME"))
strVacancy=(VACANCY("JBATitle"))
URLShort=(Recordset1("JBSURLShort"))
ReplyMail=(Recordset1("JBSNoReplyEmail"))
ConkerEmail=(VACANCY("JBAConkersEmail"))
RecEmail=(username("JBEUsername"))
Set ObjSendMail.Configuration = iConf
ObjSendMail.To = RECEmail
ObjSendMail.Subject = "Job Advert " & strVacancy & " posted on " & URLShort
ObjSendMail.From = ReplyMail
if VACANCY("JBAConkersEmail")="" then
ObjSendMail.Bcc = ConkerEmail
else
end if
ObjSendMail.ReplyTo = APEmail
ObjSendMail.TextBody = "Dear " & EmployeeName & "," & vbCRLF & "" & vbCRLF &
"Your vacancy titled " & strVacancy & " has successfully been posted on " &
URLShort & "" & vbCRLF & "" & vbCRLF & "Kind regards"
ObjSendMail.Send
Set ObjSendMail = Nothing
%>
<%
if not jbeusers.eof then
do while not jbeusers.eof
Set myMail=CreateObject("CDO.Message")
strVacancy=(VACANCY("JBATitle"))
URLShort=(Recordset1("JBSURLShort"))
ReplyMail=(Recordset1("JBSNoReplyEmail"))
myMail.Subject= "Job Advert " & strVacancy & " advertised on " & URLShort
myMail.From= ReplyMail
myMail.To= ""& jbeusers("JBENusername")&"; "
myMail. CreateHTMLBody
"../jobseeker/afterregistration/vacancynotification.asp?ID=" &VACANCY("JBAID")
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver")="smtp.domain.com"
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing
jbeusers.MoveNext
Loop
Set jbeusers = nothing
objConn.close
end if
%>
<%
' WA Application Builder Insert
if ("" = "") then
WA_connection = MM_recruta2_STRING
WA_table = "dbo.JBESent"
WA_sessionName = "JBESent_JBESID"
WA_redirectURL = "success.asp"
WA_keepQueryString = false
WA_indexField = "JBESID"
WA_fieldNamesStr =
"JBESSiteID|JBESJobID|JBESLocation|JBESCategory|JBESReceipients"
WA_fieldValuesStr = "" & cStr( Session("SITEID") ) & "" & "|" & "" &
cStr((VACANCY.Fields.Item("JBAID").Value)) & "" & "|" & "" & cStr(
Session("NEWVACANCYLOCATION") ) & "" & "|" & "" & cStr(
Session("NEWVACANCYCATEGORY") ) & "" & "|" & "" & cStr( Session("JBESENT") )
& ""
WA_columnTypesStr =
"none,none,NULL|none,none,NULL|',none,''|',none,''|none,none,NULL"
WA_comparisonStr = " = | = | LIKE | LIKE | = "
WA_fieldNames = Split(WA_fieldNamesStr,"|")
WA_fieldValues = Split(WA_fieldValuesStr,"|")
WA_columns = Split(WA_columnTypesStr,"|")
WA_comparisions = Split(WA_comparisonStr, "|")
insertParamsObj = WA_AB_generateInsertParams(WA_fieldNames, WA_columns,
WA_fieldValues, -1)
set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = WA_connection
MM_editCmd.CommandText = "INSERT INTO " & WA_table & " (" &
insertParamsObj(1) & ") VALUES (" & insertParamsObj(2) & ")"
MM_editCmd.Execute()
MM_editCmd.ActiveConnection.Close()
obj = WA_AB_generateWhereClause(WA_fieldNames, WA_columns, WA_fieldValues,
WA_comparisions)
sqlstr = "SELECT " & WA_indexField & " FROM " & WA_table & " WHERE " &
obj & " ORDER BY " & WA_indexField & " DESC"
set WA_AppBuilderRecordset = Server.CreateObject("ADODB.Recordset")
WA_AppBuilderRecordset.ActiveConnection = WA_connection
WA_AppBuilderRecordset.Source = sqlstr
WA_AppBuilderRecordset.CursorType = 0
WA_AppBuilderRecordset.CursorLocation = 2
WA_AppBuilderRecordset.LockType = 1
WA_AppBuilderRecordset.Open()
if (NOT WA_AppBuilderRecordset.EOF) then Session(WA_sessionName) =
WA_AppBuilderRecordset.Fields.Item(WA_indexField).Value
WA_AppBuilderRecordset.Close()
if (WA_redirectURL <> "") then
if (WA_keepQueryString AND Request.QueryString <> "" AND
Request.QueryString.Count > 0) then
if (inStr(WA_redirectURL,"?") > 0) then
WA_redirectURL = WA_redirectURL & "&"
else
WA_redirectURL = WA_redirectURL & "?"
end if
WA_redirectURL = WA_redirectURL & Request.QueryString
end if
Response.Redirect(WA_redirectURL)
end if
end if
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
If (jbeusers_total = -1) Then
' count the total records by iterating through the recordset
jbeusers_total=0
While (Not jbeusers.EOF)
jbeusers_total = jbeusers_total + 1
jbeusers.MoveNext
Wend
' reset the cursor to the beginning
If (jbeusers.CursorType > 0) Then
jbeusers.MoveFirst
Else
jbeusers.Requery
End If
' set the number of rows displayed on this page
If (jbeusers_numRows < 0 Or jbeusers_numRows > jbeusers_total) Then
jbeusers_numRows = jbeusers_total
End If
' set the first and last displayed record
jbeusers_first = 1
jbeusers_last = jbeusers_first + jbeusers_numRows - 1
If (jbeusers_first > jbeusers_total) Then
jbeusers_first = jbeusers_total
End If
If (jbeusers_last > jbeusers_total) Then
jbeusers_last = jbeusers_total
End If
End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>vacancypost</title>
<meta name="Robots" content="noindex,nofollow" />
</head>
<body>
</body>
</html>
<%
username.Close()
Set username = Nothing
%>
<%
jbeusers.Close()
Set jbeusers = Nothing
%>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
<%
USERS.Close()
Set USERS = Nothing
%><%
VACANCY.Close()
Set VACANCY = Nothing
%>