Mail test results; error 503

OK. Let's try this.Did a search on the community forum and found this. Emailing form resultsNOTE: Will only work if your server has been correctly configured as IIS6.First create your test and note the variable names for the questions, e.g. question_0001, question_0002, and the final score, test_1_score.Then open notepad and copy this code. Add all the To and From email addresses you want in the code. note the use of ; to have more than one address in the msg.To: line. Save file as email.asp in the folder where you are creating this Lectora test project. E.g. (My Documents/My Titles/Test/email.asp)Code:


<%@ Language=VBScript %> <% ' the variable names on the right in the quotes correspond to the variable names you created in Lectora ' the variable names on the left do not have to agree with the names on the right but it is a good convention un=request.form("Entry_0001") q1=request.form("Question_0001") q2=request.form("Question_0002") q3=request.form("Question_0003") ts=request.form("Test_1_Score") ' The variable name below outside of the quotes must agree with the variable name on the left above strBody="" strBody=strBody & "User Name: " & un & vbCrLf strBody=strBody & "Question 1: " & q1 & vbCrLf strBody=strBody & "Question 2: " & q2 & vbCrLf strBody=strBody & "Question 3: " & q3 & vbCrLf strBody=strBody & "Test Score: " & ts & "%" & vbCrLf'body of email' Send the e-mailSet msg = CreateObject("CDO.Message")msg.Configuration.Fields.Item( "http://schemas.microsoft.com/cdo/configuration/sendusing") = 2msg.Configuration.Fields.Item( "http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"msg.Configuration.Fields.Item( "http://schemas.microsoft.com/cdo/configuration/smtpconnecti ontimeout") = 10msg.Configuration.Fields.Update' type in the recipentsmsg.To = "name1@mail.com;name2@email.com"msg.From = "admin@email.com"msg.Subject = "Sending Final Test Results"' use msg.TextBody if using IIS6 on your servermsg.TextBody = strBodymsg.Sendset msg=nothing%>


In Lectora:Go to the Test Properties, and under the Results Tab, choose Submit Test to CGI Program, choose POST and in the text box for Submit results to:, add the file, email.asp.Check the box, Include all variable values in submissionIn the Title Properties, under the Additional files tab, click Add File and look for the email.asp. It should already have been saved in the folder where you are creating your Lectora project. Click Open to accept the email.asp file.Some points.The user name was received when the person taking the test entered their name in a Entry Field form placed on the first page before starting the test. That is where I got the Entry_0001, which is the default variable name from Lectora. You can also have also a email entry to capture. As seen from the code, as long as you have variables you can capture it in the emailYou can create a Results page at the end that will show the user their final test results. You can always choose only to show them their correct score or all scores.Here is some info from Microsoft regarding the CDO object model. I tried it and got this email. (I used only Matching questions.)Email:From: admin@mail.comTo: name1@mail.com;name2@mail.comSubject: Sending Final Test Results


User Name: John BrownQuestion 1: 1-1,2-2,3-3Question 2: 1-1,2-5,3-2,4-3,5-4Question 3: 1-1,2-2,3-3Test Score: 64%Let us hear from you regarding this solution.

Discussions have been disabled for this post