<% Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open Application("Connection1_ConnectionString") Set rs = Server.CreateObject("ADODB.Recordset") rs.Open "select * from TaddUser ",conn,3,3 'Set Conn = Server.CreateObject("ADODB.Connection") 'Conn.Open Application("Connection1_ConnectionString") 'Set rs = Server.CreateObject("ADODB.Recordset" FUNCTION ValidEmail(theEmail) if inStr(TheEmail,"@")>1 then if len(theEmail) - Instr(TheEmail,"@")>2 then if inStr(InStr(theEmail,"@"),TheEmail,".")>0 then if len(theEmail) - InStr(inStr(theEmail,"@"),theEmail,".")=>1 then good=1 else good=0 end if else good=0 end if else good=0 end if else good=0 end if if good = 1 then ValidEmail="True" else ValidEmail="false" end if end function if Request.Form ("Enter") <> "" then VSex = Request.form ("Sex") VFirst_Name = Request.form ("First_Name") VMiddle_Name = Request.Form("Middle_Name") VLast_Name = Request.form ("Last_Name") VTitle_Job = Request.form ("Title_Job") VCompany_Name = Request.form ("Company_Name") VAddress1 = Request.form ("Address1") VAddress2 = Request.form ("Address2") Vcity = Request.form ("city") VState = Request.form ("State") VZipCode = Request.form ("ZipCode") VCountry = Request.form ("Country") VPhone = Request.form ("Phone") VFax = Request.form ("Fax") Vemail = Request.form ("email") VDateValue = Request.Form("DateValue") if ValidEmail(request.form ("email"))="false" then msg=msg+"You have to enter an authentic Email address!" else rs.AddNew rs("Sex") = VSex rs("First_Name") = VFirst_Name rs("Middle_Name") = VMiddle_Name rs("Last_Name") = VLast_Name rs("Title_Job") = VTitle_Job rs("Company_Name") = VCompany_Name rs("Address1") = VAddress1 rs("Address2") = VAddress2 rs("city") = Vcity rs("State") = VState rs("ZipCode") = VZipCode rs("Country") = VCountry rs("Phone") = VPhone rs("Fax") = VFax rs("email") = Vemail rs("DateValue") = VDateValue rs.Update rs.MoveLast DES=chr(13)+chr(10) 'put every text field in a string to send by email textinfo = "SUBSCRIBE INTELEC" &DES &DES textinfo = "END" &DES &DES textinfo = textinfo + "Mr/Mrs/Ms :"&VSex &DES textinfo = textinfo + "First name is " &VFirst_Name &DES textinfo = textinfo + "Middle name is " &VMiddle_Name &DES textinfo = textinfo + "Last name is " &VLast_Name &DES textinfo = textinfo + "job title : " &VTitle_Job &DES textinfo = textinfo + "Company is " &VCompany_Name &DES textinfo = textinfo + "Address #1 : " &VAddress1 &DES textinfo = textinfo + "Address #2 : " &VAddress2 &DES textinfo = textinfo + "City is " &Vcity &DES textinfo = textinfo + "Province/State is " &VState &DES textinfo = textinfo + "Country is " &VCountry &DES textinfo = textinfo + "Postal Code is " &VZipCode &DES textinfo = textinfo + "Phone is " &VPhone &DES textinfo = textinfo + "Fax is " &VFax &DES textinfo = textinfo + "Email is " &Vemail &DES 'the part for the object of the mailer strFrom = Vemail strTo="majordomo@majordomo.ieee.org,bob@myers-smith.com" strSubject = "subscribe" strBody = textinfo Const cdoSendUsingPort=2 strSMTP="energy.ece.uiuc.edu" ' Ok it is time to construct and send the message. Dim iMsg Dim iConf set iMsg=CreateObject("CDO.Message") set iConf=CreateObject("CDO.Configuration") 'for setting the configuration of the msg iMsg.From=strFrom iMsg.To=strTo iMsg.Subject=strSubject iMsg.TextBody=strBody Set Flds = iConf.Fields 'redundant but more readable maybe With Flds .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSMTP .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 .Update End With Set iMsg.Configuration = iConf iMsg.Send Response.Redirect("ThankYou2.asp?Name1="&VFirst_Name&"&name2="&VLast_Name&"&flag=1") end if 'sql="insert into TaddUser(Sex,First_Name,Last_Name,Title_Job,Company_Name,Address1,Address2,city,State,ZipCode,Country,PhoneCode,Phone,FaxCode,Fax,email)values(VSex,VFirst_Name,VLast_Name,VTitle_Job,VCompany_Name,VAddress1,VAddress2,Vcity,VState,VZipCode,VCountry,VPhoneCode,VPhone,VFaxCode,VFax,Vemail)" 'sql2="Select * from Tclients where clientId ="&ClientID 'Set rs = Conn.Execute(sql) ' end if'the button %> Client Application <%=msg%>
Intelec Logo
Update our mailing list
IMPORTANT:We are updating our INTELEC mailing list to serve you better.To ensure that your name is on the updated mailing list and you continue to receive INTELEC mailings, please fill out the complete form below and return to INTELEC by clicking on the send button:
 
First name:
Last name:
<% 'rs.Close 'set rs = nothing conn.Close set conn = nothing %>
Your Job Title:
Company name: 
Address :
Address (continued) :
City:
State/Province:
Zip/Postal code:
Country:
Phone: (Incl. area code)
Fax:
E-mail:
I prefer to be contacted by:
Email       Postal Mail

Please remove my name from the INTELEC database.