J
JA
I am trying to create a notification program using sql
databases and my SMTP. It does not run. Please what is
wrong?
<!--#INCLUDE VIRTUAL="DB_Connection/EUT_Connection.asp"-->
<!--#INCLUDE
VIRTUAL="DB_Connection/Employee_Connection.asp"-->
<!--#include file = "DB_Connection/SendEmail.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
<%
Server.ScriptTimeout = 999999
on error resume next
Set CourseSchedule = Server.CreateObject
("ADODB.Recordset")
'To Retrieve Course Schedule information
If weekday(date()) = 3 then
CourseScheduleRec = "SELECT * FROM OtherAffiliates
WHERE Datediff(day,getDate(),StartDate) = 1 or Datediff
(day,getDate(),StartDate) = 4"
else
CourseScheduleRec = "SELECT * FROM OtherAffiliates
WHERE Datediff(day,getDate(),StartDate) = 1"
end if
CourseSchedule.Open CourseScheduleRec, EUT_Connection, 1,
3
DO WHILE NOT CourseSchedule.EOF
Set EmpInfo = Server.CreateObject
("ADODB.Recordset")
'Retrive Employee Information
EmpInfoQuery = "SELECT
EmailAddress FROM View_EmailAddress WHERE ID = '" & right
(CourseSchedule("userID"),6) & "'"
EmpInfpen EmpInfoQuery ,
Employee_Connection, 1, 3
If NOT EmpInfo.EOF Then
EmpMail = EmpInfo
("EmailAddress")
end if
CourseSAPM = CourseSchedule
("SAPModule")
CourseCode = CourseSchedule("CourseCode")
CourseDesc = CourseSchedule
("CourseDecription")
CourseDate = CourseSchedule("StartDate")
CourseSTime = CourseSchedule("Start_Time")
CourseLoc = CourseSchedule("Location")
CourseRoom = CourseSchedule("Room")
CourseDur = CourseSchedule("duration")
strBody = ""
strFrom
= "EUT_Training_System"
strSubject = "REMINDER: " &
CourseDesc
' StrTo = EmpMail
& "@sabic.com"
StrTo
= "(e-mail address removed)"
strCc
= "(e-mail address removed)"
%>
<!--#include file = "EmailHdr.asp" -->
<%
strBody = strBody & vbCrLf _
& " <p><font face=""Verdana""
size=2>" & vbCrLf _
& "<body bgcolor=""White"">" &
vbCrLf _
& " <h3>Hello Mr. " &
CourseSchedule("UserName") & "</h3>" & vbCrLf _
& " This is just a
reminder for your scheduled training class: ( <B><U>" &
CourseSchedule("CourseDecription") & "</B></U> ) that will
be started on <B><U>" & CourseSchedule("StartDate")
& "</B></U>.<br>" & vbCrLf _
& "Therefore, please DO NOT
miss it. <br><br>" & vbCrLf _
& "SAP Moodule : <font
face=""Verdana"" color=""#FF0000""><b>" & CourseSAPM
& "</b></font><br>" & vbCrLf _
& "Course Code : <font
face=""Verdana"" color=""#FF0000""><b>" & CourseCode
& "</b></font><br>" & vbCrLf _
& "Course Title : <font
face=""Verdana"" color=""#FF0000""><b>" & CourseDesc
& "</b></font><br>" & vbCrLf _
& "Duration : <font
face=""Verdana"" color=""#FF0000""><b>" & CourseDur & "
day(s)" & "</b></font><br>" & vbCrLf _
& "Schedule Date : <font
face=""Verdana"" color=""#FF0000""><b>" & CourseDate
& "</b></font><br>" & vbCrLf _
& "Start Time : <font
face=""Verdana"" color=""#FF0000""><b>" & CourseSTime
& "</b></font><br>" & vbCrLf _
& "Course Loc. : <font
face=""Verdana"" color=""#FF0000""><b>" & CourseLoc
& "</b></font><br>" & vbCrLf _
& "Course Room : <font
face=""Verdana"" color=""#FF0000""><b>" & CourseRoom
& "</b></font><br><br>" & vbCrLf _
& " For more details, please
click <a href='http://hq-reg-
2/training_apps/catalogues/schedule/group1/sadaf_course_out
line.asp?badgeno=" & CourseSchedule("userID")
& "'>here</a>. <br>" & vbCrLf _
& " <br>Thank You,<br>" &
vbCrLf _
& " EUT Training System
<br>" & vbCrLf _
& " Ext. 3734 <br>" &
vbCrLf _
& " </p></font>" & vbCrLf _
& "</body>" & vbCrLf _
& "</html>" & vbCrLf
Mailing strTo, strFrom, strSubject,
strBody, strCc
CourseSchedule.MoveNext
LOOP
if err <> 0 then
response.write Err.description
else
response.write "<hr></hr><font face=""Verdana""
color=""#ff0000"" size=2>" & "The Notification message has
been sent successfully. " & "<br></font>"
response.write "<font face=""Verdana""
color=""#0000FF"" size=2>" & "Last run for EUT Reminder
was on : " & now() & "</font><hr></hr>"
end if
%>
</body>
</html>
databases and my SMTP. It does not run. Please what is
wrong?
<!--#INCLUDE VIRTUAL="DB_Connection/EUT_Connection.asp"-->
<!--#INCLUDE
VIRTUAL="DB_Connection/Employee_Connection.asp"-->
<!--#include file = "DB_Connection/SendEmail.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
<%
Server.ScriptTimeout = 999999
on error resume next
Set CourseSchedule = Server.CreateObject
("ADODB.Recordset")
'To Retrieve Course Schedule information
If weekday(date()) = 3 then
CourseScheduleRec = "SELECT * FROM OtherAffiliates
WHERE Datediff(day,getDate(),StartDate) = 1 or Datediff
(day,getDate(),StartDate) = 4"
else
CourseScheduleRec = "SELECT * FROM OtherAffiliates
WHERE Datediff(day,getDate(),StartDate) = 1"
end if
CourseSchedule.Open CourseScheduleRec, EUT_Connection, 1,
3
DO WHILE NOT CourseSchedule.EOF
Set EmpInfo = Server.CreateObject
("ADODB.Recordset")
'Retrive Employee Information
EmpInfoQuery = "SELECT
EmailAddress FROM View_EmailAddress WHERE ID = '" & right
(CourseSchedule("userID"),6) & "'"
EmpInfpen EmpInfoQuery ,
Employee_Connection, 1, 3
If NOT EmpInfo.EOF Then
EmpMail = EmpInfo
("EmailAddress")
end if
CourseSAPM = CourseSchedule
("SAPModule")
CourseCode = CourseSchedule("CourseCode")
CourseDesc = CourseSchedule
("CourseDecription")
CourseDate = CourseSchedule("StartDate")
CourseSTime = CourseSchedule("Start_Time")
CourseLoc = CourseSchedule("Location")
CourseRoom = CourseSchedule("Room")
CourseDur = CourseSchedule("duration")
strBody = ""
strFrom
= "EUT_Training_System"
strSubject = "REMINDER: " &
CourseDesc
' StrTo = EmpMail
& "@sabic.com"
StrTo
= "(e-mail address removed)"
strCc
= "(e-mail address removed)"
%>
<!--#include file = "EmailHdr.asp" -->
<%
strBody = strBody & vbCrLf _
& " <p><font face=""Verdana""
size=2>" & vbCrLf _
& "<body bgcolor=""White"">" &
vbCrLf _
& " <h3>Hello Mr. " &
CourseSchedule("UserName") & "</h3>" & vbCrLf _
& " This is just a
reminder for your scheduled training class: ( <B><U>" &
CourseSchedule("CourseDecription") & "</B></U> ) that will
be started on <B><U>" & CourseSchedule("StartDate")
& "</B></U>.<br>" & vbCrLf _
& "Therefore, please DO NOT
miss it. <br><br>" & vbCrLf _
& "SAP Moodule : <font
face=""Verdana"" color=""#FF0000""><b>" & CourseSAPM
& "</b></font><br>" & vbCrLf _
& "Course Code : <font
face=""Verdana"" color=""#FF0000""><b>" & CourseCode
& "</b></font><br>" & vbCrLf _
& "Course Title : <font
face=""Verdana"" color=""#FF0000""><b>" & CourseDesc
& "</b></font><br>" & vbCrLf _
& "Duration : <font
face=""Verdana"" color=""#FF0000""><b>" & CourseDur & "
day(s)" & "</b></font><br>" & vbCrLf _
& "Schedule Date : <font
face=""Verdana"" color=""#FF0000""><b>" & CourseDate
& "</b></font><br>" & vbCrLf _
& "Start Time : <font
face=""Verdana"" color=""#FF0000""><b>" & CourseSTime
& "</b></font><br>" & vbCrLf _
& "Course Loc. : <font
face=""Verdana"" color=""#FF0000""><b>" & CourseLoc
& "</b></font><br>" & vbCrLf _
& "Course Room : <font
face=""Verdana"" color=""#FF0000""><b>" & CourseRoom
& "</b></font><br><br>" & vbCrLf _
& " For more details, please
click <a href='http://hq-reg-
2/training_apps/catalogues/schedule/group1/sadaf_course_out
line.asp?badgeno=" & CourseSchedule("userID")
& "'>here</a>. <br>" & vbCrLf _
& " <br>Thank You,<br>" &
vbCrLf _
& " EUT Training System
<br>" & vbCrLf _
& " Ext. 3734 <br>" &
vbCrLf _
& " </p></font>" & vbCrLf _
& "</body>" & vbCrLf _
& "</html>" & vbCrLf
Mailing strTo, strFrom, strSubject,
strBody, strCc
CourseSchedule.MoveNext
LOOP
if err <> 0 then
response.write Err.description
else
response.write "<hr></hr><font face=""Verdana""
color=""#ff0000"" size=2>" & "The Notification message has
been sent successfully. " & "<br></font>"
response.write "<font face=""Verdana""
color=""#0000FF"" size=2>" & "Last run for EUT Reminder
was on : " & now() & "</font><hr></hr>"
end if
%>
</body>
</html>