<%@ LANGUAGE = "VBSCRIPT" %> <% '### WHAT ERROR CODES IN QUERY STRING MEAN ### ' 0 = No meaning. As long as errorcode is NOT set to 1,2 or 3, page will display "password has been emailed" ' text. ' 1 = Password request. This page with errorcode 1 will allow the user will enter his/her email ' address in the textbox for password to be emailed to him/her. ' 2 = Password already exists in the database and user was re-registering with the same email ' address (perhaps to get a new password?). This page tells him/her that it already exists and ' would allow the user to have the password emailed to her by clicking on a link. ' 3 = This error code means that the password has been requested and will access the database. This ' is done in the code below. Most likely, a re-submit is made to this page but with this errorcode ' to perform the database and emailing tasks. ' 4 = This error code means that the database does not contain the email address that was sent in the ' query string. A message is displayed asking to re-register. '###### error_code = Request.QueryString("errorcode") email_address = Request.QueryString("emailaddress") req_password = "" IF error_code = 3 THEN Set OBJdbConnection = Server.CreateObject("ADODB.Connection") Set RS = Server.CreateObject("ADODB.RecordSet") OBJdbConnection.Open DatabaseConnection 'DatabaseConnection from setup.inc IF email_address = "" THEN email_address = Request.Form("email") END IF SQLQuery = "SELECT m_password FROM " & TableName & " WHERE m_username = '" & MakeInputDBaseSafe(email_address) & "';" RS.Open SQLQuery, OBJdbConnection IF NOT RS.EOF THEN req_password = RS("m_password") error_code = 0 '##### Email password to the person fHTML = "mailing_password_req.asp" FUNCTION textToPrint(strTempBuffer,startmark,endmark) Dim MarkedBlkStart, MarkedBlkEnd, MarkedBlkLength 'get position of end of starting marker MarkedBlkStart = (InStr(strTempBuffer,startmark) + Len(startmark)) 'Check for error and die if true IF MarkedBlkStart = Len(startmark) THEN ' length of block marker here too textToPrint = "ERROR - Could not find start of block marked for title (","") ' variables for email set up strEmailBuffer1 = strEmailTitle 'holds current email content blobk 1 (Email Title) NB doesn't change strEmailBuffer2 = "" 'holds current email content blobk 2 (Email Body) NB changes strEmailBuffer3 = "" 'holds current email content blobk 3 (remove links - not used - folded into buffer2) ThisEmail = "FirstTime" ThisName = "" fTo = email_address fFrom = "website@cubralco.co.uk" fSubject = "From Web Site Mailing page" 'str_domain = "cubralco" str_domain = "uc4" messagetype = "html" objectype = EmailerObjectType Dim fcontent Dim i ' need to intoduce check where referring page is on same domain Dim HTTP_REFERER HTTP_REFERER= Request.Servervariables("HTTP_REFERER") ' Replace the designated tags for the username and password ' with the actual details in variables. This is for the HTML email. strEmailBody = Replace(strEmailBody, "", email_address) strEmailBody = Replace(strEmailBody, "", req_password) '--- Send out HTML email to registered users 'IF (InStr(HTTP_REFERER,str_domain)) THEN IF messagetype = "html" THEN fcontent = strEmailBody ELSE fcontent = "Thank you for request. Please find your log-in details below" & vbCrLf & vbCrLf fcontent = fcontent & "Username: " & user_name & vbCrLf fcontent = fcontent & "Password: " & req_password & vbCrLf & vbCrLf fcontent = fcontent & "CuBrAlco" & vbCrLf END IF IF objectype = "cdonts" THEN Set MailerConf = Server.CreateObject("CDO.Configuration") Set Flds = MailerConf.Fields Flds(cdoSendUsingMethod) = cdoSendUsingPort Flds(cdoSMTPServer) = SMTPServer Flds.Update '*** Now set and send the email (CODSYS 2000 VERSION) Set Mailer = Server.CreateObject("CDO.Message") Mailer.Configuration = MailerConf Mailer.To = fTo Mailer.From = fFrom Mailer.Subject = fSubject IF messagetype = "html" THEN Mailer.HTMLBody = fcontent ELSE Mailer.TextBody = fcontent END IF Mailer.Send Set Mailer = Nothing Set MailerConf = Nothing Set Flds = Nothing ELSEIF objectype = "aspmail" THEN '*** Now set and send the email (ASPMAIL VERSION) Set Mailer = Server.CreateObject("SMTPsvg.Mailer") Mailer.FromName = fFrom Mailer.FromAddress= fFrom Mailer.RemoteHost = "sitemail.f-ten.net" Mailer.AddRecipient fTo, fTo IF messagetype = "html" THEN Mailer.ContentType = "text/html" END IF Mailer.Subject = fSubject Mailer.QMessage = true Mailer.BodyText = fcontent IF NOT Mailer.SendMail THEN Response.Write "Error - " & Mailer.Response END IF Set Mailer = Nothing END IF 'from "IF objectype = "cdonts" THEN" 'END IF 'from "IF (InStr(HTTP_REFERER,str_domain)) THEN" ELSE error_code = 4 END IF 'from "IF NOT RS.EOF THEN" END IF %> CuBrAlco - The UK's Premier Copper Supplier
Contact us now  +44(0)1562 825152   sales@cubralco.com
CuBrAlco - The UK's Premier Copper Supplier.Independent Distributor of Copper and Plumbing Products to the UK Trade
Tubes
Plumbing Tubes
Industrial Tubes
plumbing fittings
end feed plumbing fittings
compression plumbing fittings
TradeX Budget Bulk Buy Plumbing Fittings
lead free solder ring ffittings
jg-speedfit fittings
chrome compression plumbing fittings
oil and gas fittings
 plumbing flexible connectors
plumbing valves and brassware
taps
tools-and-consumables
Strip and Rolled
Roofing
Raiwater Goods
Industrial Strips
Online Trade Ordering
Home
Contact Us
Company Profile
Terms and Conditions
Links

CuBrAlco Email Subscription

Complete the subscription form below to receive emails from us when new products are introduced or for details of special offers and promotions:

Subscribe to our mailing list

* indicates required


Please note we will not share your details with any other company.
We will only use the information supplied to contact you from time to time with details of new products or promotions from CuBrAlco Limited. You can unsubscibe at any time.