How to create a notification program from MS FP

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) & "'"
EmpInfo_Open 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>
 
J

Jim Cheshire

JA said:
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


You might want to start by removing the "On Error Resume Next". You may be
encountering an error that you don't see which causes it to run incorrectly.

--
Jim Cheshire
Jimco
http://www.jimcoaddins.com
================================
Author of Special Edition
Using Microsoft Office FrontPage 2003
5 Stars on Amazon and B&N
================================
The opinions expressed by me in the
newsgroups are my own opinions and
are in no way associated with my
employer or any other party. Jimco is
not associated in any way with any other
entity.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top