I have just upgraded to the latest version of ASPRunner and converted my project. The sendmail event nolonger works. Here is the code:
include/commonfunctions.asp
Set myMail=CreateObject("CDO.Message")
myMail.Subject = subject
myMail.From=cfrom
myMail.To=email
myMail.HTMLBody= message
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")=csmtpserver
'Server port
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=csmtpport
' SMTP username and passwords
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cÂdo/configuration/sendpassword") = csmtppassword
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cÂdo/configuration/sendusername") = csmtpuser
myMail.Configuration.Fields.Update
myMail.Send
Set myMail = Nothing
Sub AfterAdd()
'** Send simple email ****
' do not forget to setup email parameters like From, SMTP server etc
' on 'Security->User login settings' dialog
'
if getrequestform("LeaveType")= 8 then
'
Response.Redirect "tblLeaveRequests_list.asp?action=backtolist"
'
else
'
email=GetRequestForm("EmailAddress")
'message= "Start Date: " & GetRequestForm("LeaveStart") & "
" & "End Date: " & GetRequestForm("LeaveEnd")& "
" & "Notes: " & GetRequestForm("AdditionalInfo")& "
" & "
" & "Please authorise by logging onto the " & "<A HREF=""http:\\bbcapps1046\GFC_LEAVE"">""Annual Leave Website""</a>"
message ="<table border = 1 cellpadding=3 cellspacing=0 style=border-collapse: collapse bordercolor=#111111 width=235><tr><td width=135 bgcolor=#83C7C6 align=right><b>Start Date :</b></td><td width=97>" & GetRequestForm("LeaveStart") & "</td></tr><tr><td width=135 bgcolor=#83C7C6 align=right><b>End Date :</b></td><td width=97>" & GetRequestForm("LeaveEnd") &"</td></tr><tr><td width=135 bgcolor=#83C7C6 align=right><b>Notes :</b></td><td width=97>" & GetRequestForm("AdditionalInfo")& "</td></tr></table>
Please authorize by clicking " & "<a href=http:\\bbcapps1046\GFC_LEAVE\login.asp>here</a> and logging onto the GFC Leave database.<BR>Select <font color=#800080>Main Menu</font> and you will find this request under <font color=#800080>Direct Reports - Outstanding Leave.</font></p>"
'
If dict("LeaveType") = 1 then
subject="New ANNUAL Leave Request from " & GetRequestForm("MyName")
ElseIf dict("LeaveType") = 2 then
subject="New LONG SERVICE Leave Request from " & GetRequestForm("MyName")
ElseIf dict("LeaveType") = 3 then
subject="New ADDITIONAL Leave Request from " & GetRequestForm("MyName")
ElseIf dict("LeaveType") = 4 then
subject="New COMPASSIONATE Leave Request from " & GetRequestForm("MyName")
ElseIf dict("LeaveType") = 5 then
subject="New MATERNITY Leave Request from " & GetRequestForm("MyName")
ElseIf dict("LeaveType") = 6 then
subject="New TRAINING Leave Request from " & GetRequestForm("MyName")
ElseIf dict("LeaveType") = 7 then
subject="New STUDY Leave Request from " & GetRequestForm("MyName")
ElseIf dict("LeaveType") = 9 then
subject="New BOUGHT/(SOLD) Leave Request from " & GetRequestForm("MyName")
ElseIf dict("LeaveType") = 10 then
subject="New HOME WORKING Request from " & GetRequestForm("MyName")
else
subject="New Leave Request from " & GetRequestForm("MyName")
'
end if
'
sendmail email, subject, message
'
Response.Redirect "tblLeaveRequests_list.asp?action=backtolist"
'
end if
'
End Sub
Any ideas on how to fix gratefully received.