473,383 Members | 1,725 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Page is not automatically sending confirmation e-mails

28
Hi everyone,

I have an asp page that is not sending out the confirmation e-mails when a student completes an online registration process. Could you please take a look at the attached code and tell me what I might be doing wrong??

Thanks


Expand|Select|Wrap|Line Numbers
  1. <!--#include file="../Secure/IncludeFiles/Db.asp"-->
  2. <!--#include file="../javalib/start.asp"-->
  3.  
  4. <%
  5. teamID = Request("TeamID")
  6. SchoolID = Request("SchoolID") 
  7.  
  8. Set objCommand = Server.CreateObject("ADODB.Command")
  9.         objCommand.activeConnection = objConn
  10.   'set command object type
  11.         objCommand.CommandType = 4
  12.   'set command object stored procedure
  13.         objCommand.commandText = "SpEmailStudentList"
  14.   'set command object parameter names
  15.         objCommand.Parameters.Append objCommand.CreateParameter("TeamID",adInteger,adParamInput)
  16.         objCommand.Parameters.Append objCommand.CreateParameter("SchoolID",adInteger,adParamInput)
  17.  'set the command object parameter values
  18.         objCommand.Parameters("TeamID").Value=teamID
  19.         objCommand.Parameters("SchoolID").Value=SchoolID
  20.  
  21.   'execute the command
  22.        Set rsEmailStudentList = objCommand.execute
  23.  
  24.  
  25. Do While not rsEmailStudentList.eof
  26.  
  27.     EmailFrom = Application("AdminEmail")
  28.     EmailTo = rsEmailStudentList("EmailAddress")
  29.     EmailSubject = "JSE / Liberty Investment Challenge - " & rsEmailStudentList("Team")
  30.     EmailBody = "Hi " & rsEmailStudentList("FirstName") & " " & rsEmailStudentList("LastName") & "," & chr(13) & chr(13) 
  31.     EmailBody = EmailBody + "Thank You for registering for the JSE / Liberty Investment Challenge. " & chr(13) & chr(13) & "Your Team " & rsEmailStudentList("Team") & " has been successfully added to our system at http://schools.jse.co.za. " & chr(13) & chr(13) 
  32.     if not isnull(rsEmailStudentList("Username")) and rsEmailStudentList("Username") <> "" then
  33.         EmailBody = EmailBody + "You can now login and commence trading using:" & chr(13) & chr(13) & "username: " & rsEmailStudentList("Username") & chr(13) & "password: " &  rsEmailStudentList("Password") & chr(13) & chr(13) 
  34.     end if
  35.     EmailBody = EmailBody + "Good luck to all learners on behalf of the JSE Securities Exchange South Africa and our sponsor Liberty."
  36.     EmailBody = EmailBody + chr(13) & chr(13) 
  37.     EmailBody = EmailBody + "Should you have any queries please contact us at the email address or phone number below." & chr(13) & chr(13) 
  38.     EmailBody = EmailBody + "mailto:"&Application("AdminEmail") & chr(13) & chr(13)
  39.     EmailBody = EmailBody + "Phone Idris on  : (011) 520-7168" & chr(13)  
  40.     EmailBody = EmailBody + "Phone Desiree on : (011) 520-7116" & chr(13)  
  41.     EmailBody = EmailBody + "Phone Jenny on : (011) 520-7344" & chr(13)  
  42.  
  43.  
  44.     if EmailFrom <> "" and EmailTo <> "" and EmailSubject <> "" and EmailBody <> "" then
  45.         '-----------Start email---------------------------
  46.         Set Mailer = CreateObject("CDO.Message")
  47.           Mailer.From = EmailFrom
  48.           Mailer.To = EmailTo
  49.           Mailer.Subject= EmailSubject
  50.           Mailer.TextBody=EmailBody
  51.           Mailer.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
  52.         Mailer.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "196.37.145.132"
  53.         Mailer.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
  54.         Mailer.Configuration.Fields.Update 
  55.           Mailer.Send
  56.         Set Mailer = Nothing
  57.     end if
  58.  
  59.     rsEmailStudentList.movenext()
  60.  
  61. loop
  62.  
  63. Response.Redirect("Thanks.asp")
  64.  
  65. %>
  66.  
Attached Files
File Type: docx Code email.docx (16.6 KB, 367 views)
Feb 27 '12 #1
0 1501

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Danny | last post by:
Hello I would like to run an ASP page each day at the same time automatically. it reads from my product data and ftps the data to another server. I am running on a windows system with IIS I...
4
by: AMC | last post by:
Hi, I have a page that allows user input. On click of the submit button I call a javascript function that verifies that all of the fields are filled out and then submits the form. I need to add...
2
by: Kamyk | last post by:
Hello all! I have created a function in VB which generate appointment in Outlook. Everything is OK, except one thing. I cannot send it automatically using a button in Access, because I don`t...
3
by: Stephen V | last post by:
Can anyone help me out with this problem. I would like to redirect/ go to another php page when my SQL insertion is done and also send a variable at the same time. the idea is, to come on my...
1
by: Jakey Jake | last post by:
Hi, I need some HTML / Javascript that will automatically reload or refresh my page after 5 minutes. I have tried Meta in HTML but I cant access the <Head> as its not entirely my page. Can...
4
by: SHorn | last post by:
Hi all- I created a macro that sends out an email. I am now running into the issue of a security box poping up in which I have to click yes to allow the email to send. It reads: "A program is...
10
by: Sam Polos | last post by:
Is there a way, with javascript, that if someones visits a webpage that I automatically get an email with information about the visitor? Info such as IP, referrer, etc. Thanks.
2
by: Jodye Roebuck | last post by:
I have a program that's been automatically generating and sending emails flawlessly. My clients workstation had an automatic Microsoft security update done on it.. and now it's bombing on this...
7
by: tanyali | last post by:
Hi guys, I wanna to execute a php page automatically in the background, or execute it in shell script, and set this script to execute as a cron job. so who knows either of the two questions...
5
by: nttuanit | last post by:
I have a Web App, I want to start Main page automatically after IIS is started without any request from browser. OR run one Script in Global.asax after IIS started. I understand that the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.