<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% FUNCTION SendMail() sendUrl="http://schemas.microsoft.com/cdo/configuration/sendusing" smtpUrl="http://schemas.microsoft.com/cdo/configuration/smtpserver" ' Set the mail server configuration Set objConfig=CreateObject("CDO.Configuration") objConfig.Fields.Item(sendUrl)=2 ' cdoSendUsingPort objConfig.Fields.Item(smtpUrl)="relay-hosting.secureserver.net" objConfig.Fields.Update ' Create and send the mail Set objMail=CreateObject("CDO.Message") ' Use the config object created above Set objMail.Configuration=objConfig objMail.From="subscribe@bpchorus.org" objMail.To="subscribe@bpchorus.org" objMail.Subject="Become a friend of the chorus!" objMail.TextBody="The following person has subscribed to Friends of the Chorus:" & vbCrLf & cEmailAddress objMail.Send Set objMail = Nothing END FUNCTION FUNCTION SendThankyou() sendUrl="http://schemas.microsoft.com/cdo/configuration/sendusing" smtpUrl="http://schemas.microsoft.com/cdo/configuration/smtpserver" ' Set the mail server configuration Set objConfig=CreateObject("CDO.Configuration") objConfig.Fields.Item(sendUrl)=2 ' cdoSendUsingPort objConfig.Fields.Item(smtpUrl)="relay-hosting.secureserver.net" objConfig.Fields.Update ' Create and send the mail Set objMail=CreateObject("CDO.Message") ' Use the config object created above Set objMail.Configuration=objConfig objMail.From="subscribe@bpchorus.com" objMail.To=cEmailAddress objMail.Subject="Friends of the Buffalo Philharmonic Chorus" objMail.TextBody="This e-mail is to confirm that you have subscribed to Friends of the Buffalo Philharmonic Chorus. Thank you!" objMail.Send Set objMail = Nothing END FUNCTION %> <% Dim Mailer, Body, cValidated, cDelivered Dim cEmailAddress Dim eErr, eEmail, eConfirm cDelivered = false cValidated = true IF request("action") = "subscribe" THEN 'pull the request vars cEmailAddress = trim(request("EmailAddress")) 'do form validation IF cEmailAddress = "" THEN cValidated = false eEmail = "
Please enter your email." END IF IF NOT InStr(cEmailAddress,"@") > 0 THEN cValidated = false:eEmail = "
Please enter your email." IF NOT InStr(cEmailAddress,".") > 0 THEN cValidated = false:eEmail = "
Please enter your email." IF InStr(cEmailAddress,"http") > 0 THEN cValidated = false:eEmail = "
Please enter your email." 'send it IF cValidated = true THEN SendMail SendThankyou cDelivered = true eConfirm = "Thank you! Please check your email for confirmation." END IF END IF %> Buffalo Philharmonic Chorus
Become a friend of the Buffalo Philharmonic Chorus!
<%=eEmail%><%=eConfirm%>
  enter your email address

LATEST NEWS:

Doreen Rao brings energy surge to BPC - read more