KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.62
System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64
User : www ( 80)
PHP Version : 8.3.8
Disable Function : NONE
Directory :  /domains/thuebner/scripts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /domains/thuebner/scripts/formmail.asp
<HTML>
<HEAD>
  <META NAME="GENERATOR" CONTENT="Adobe PageMill 3.0 Win">
  <TITLE>Form Mail</TITLE>
</HEAD>
<BODY>

<P><!--SELECTION--><!--/SELECTION-->&lt;%@ LANGUAGE=&quot;VBScript&quot;
%&gt; &lt;% '***************************************************************************
'* ASP FormMail * '* * '* Do not remove this notice. * '* * '*
Copyright 1999, 2000 by Mike Hall. * '* Please see http://www.brainjar.com
for documentation and terms of use. * '***************************************************************************
'- Customization of these values is required, see documentation.
----------- referers = Array(&quot;www.njonas.com&quot;, &quot;njonas.com&quot;)
mailComp = &quot;ASPMail&quot; smtpServer = &quot;mail.njonas.com&quot;
fromAddr = &quot;[email protected]&quot; '- End required customization
section. ------------------------------------- Response.Buffer
= true errorMsgs = Array() 'Check for form data. if Request.ServerVariables(&quot;Content_Length&quot;)
= 0 then call AddErrorMsg(&quot;No form data submitted.&quot;)
end if 'Check if referer is allowed. validReferer = false referer
= GetHost(Request.ServerVariables(&quot;HTTP_REFERER&quot;)) for
each host in referers if host = referer then validReferer = true
end if next if not validReferer then if referer = &quot;&quot;
then call AddErrorMsg(&quot;No referer.&quot;) else call AddErrorMsg(&quot;Invalid
referer: '&quot; & referer & &quot;'.&quot;) end if end if 'Check
for the recipients field. if Request.Form(&quot;_recipients&quot;)
= &quot;&quot; then call AddErrorMsg(&quot;Missing email recipient.&quot;)
end if 'Check all recipient email addresses. recipients = Split(Request.Form(&quot;_recipients&quot;),
&quot;,&quot;) for each name in recipients name = Trim(name) if
not IsValidEmail(name) then call AddErrorMsg(&quot;Invalid email
address in recipient list: &quot; & name & &quot;.&quot;) end
if next recipients = Join(recipients, &quot;,&quot;) 'Get replyTo
email address from specified field, if given, and check it. name
= Trim(Request.Form(&quot;_replyToField&quot;)) if name &lt;&gt;
&quot;&quot; then replyTo = Request.Form(name) else replyTo =
Request.Form(&quot;_replyTo&quot;) end if if replyTo &lt;&gt;
&quot;&quot; then if not IsValidEmail(replyTo) then call AddErrorMsg(&quot;Invalid
email address in reply-to field: &quot; & replyTo & &quot;.&quot;)
end if end if 'Get subject text. subject = Request.Form(&quot;_subject&quot;)
'If required fields are specified, check for them. if Request.Form(&quot;_requiredFields&quot;)
&lt;&gt; &quot;&quot; then required = Split(Request.Form(&quot;_requiredFields&quot;),
&quot;,&quot;) for each name in required name = Trim(name) if
Left(name, 1) &lt;&gt; &quot;_&quot; and Request.Form(name) =
&quot;&quot; then call AddErrorMsg(&quot;Missing value for &quot;
& name) end if next end if 'If a field order was given, use it.
Otherwise use the order the fields were 'received in. str = &quot;&quot;
if Request.Form(&quot;_fieldOrder&quot;) &lt;&gt; &quot;&quot;
then fieldOrder = Split(Request.Form(&quot;_fieldOrder&quot;),
&quot;,&quot;) for each name in fieldOrder if str &lt;&gt; &quot;&quot;
then str = str & &quot;,&quot; end if str = str & Trim(name) next
fieldOrder = Split(str, &quot;,&quot;) else fieldOrder = FormFieldList()
end if 'If there were no errors, build the email note and send
it. if UBound(errorMsgs) &lt; 0 then 'Build table of form fields
and values. body = &quot;& & & & & & & <TABLE BORDER="0" CELLPADDING="2"
CELLSPACING="0">
  " vbCrLf for each name in fieldOrder body = body _ "
  <TR VALIGN="TOP">
    " _ "
    <TD>
    <B>&quot; _ & name _ & &quot;:&nbsp;</B></TD>" _ "
    <TD>
    &quot; _ & Request.Form(name) _ & &quot;</TD>" _ "
  </TR>" vbCrLf next body = body "
</TABLE>&quot; & vbCrLf 'Add a table with any environmental variables.
if Request.Form(&quot;_envars&quot;) &lt;&gt; &quot;&quot; then
body = body _ & &quot;</P>

<P>&quot; _ & &quot;& & & & & & & <TABLE BORDER="0" CELLPADDING="2"
CELLSPACING="0">
  " vbCrLf envars = Split(Request.Form("_envars"), ",") for each name in envars name = Trim(name) body = body _ "
  <TR VALIGN="TOP">
    " _ "
    <TD>
    <B>&quot; _ & name _ & &quot;:&nbsp;</B></TD>" _ "
    <TD>
    &quot; _ & Request.ServerVariables(name) _ & &quot;</TD>" _ "
  </TR>" vbCrLf next body = body "
</TABLE>&quot; & vbCrLf end if 'Send it. str = SendMail() if str
&lt;&gt; &quot;&quot; then AddErrorMsg(str) end if 'Redirect if
a URL was given. if Request.Form(&quot;_redirect&quot;) &lt;&gt;
&quot;&quot; then Response.Redirect(Request.Form(&quot;_redirect&quot;))
end if end if %&gt; <html><head> <style style="text/css"> body
{ background-color: #ffffff; color: #000000; font-family: Arial,
Helvetica, sans-serif; font-size: 10pt; } table { border: solid
1px #000000; border-collapse: collapse; } td, th { border: solid
1px #000000; border-collapse: collapse; font-family: Arial, Helvetica,
sans-serif; font-size: 10pt; padding: 2px; padding-left: 8px;
padding-right: 8px; } .error { color: #c00000; } </style> </head><body>&lt;%
if UBound(errorMsgs) &gt;= 0 then %&gt;</P>

<P class="error">Form could not be processed due to the following
errors:</P>

<UL>
  <P>&lt;% for each msg in errorMsgs %&gt;
  <LI class="error">&lt;% = msg %&gt; &lt;% next %&gt;
</UL>

<P></td></tr></table>&lt;% else %&gt; <TABLE CELLPADDING="0"
CELLSPACING="0" WIDTH="450" BORDER="0">
  <TR style="background-color:#c0c0c0;">
    <TH COLSPAN="2" VALIGN="BOTTOM">
    Thank you, the following information has been sent:</TH>
  </TR><% for each name in fieldOrder %>
  <TR style="background-color:#ffffff;" VALIGN="TOP">
    <TD>
    <B>&lt;% = name %&gt;</B>&nbsp;</TD>
    <TD>
    &lt;% = Request.Form(name) %&gt;&nbsp;</TD>
  </TR><% next %>
</TABLE>&lt;% end if %&gt; &lt;% '---------------------------------------------------------------------------
' Subroutines and functions. '---------------------------------------------------------------------------
sub AddErrorMsg(msg) dim n 'Add an error message to the list.
n = UBound(errorMsgs) Redim Preserve errorMsgs(n + 1) errorMsgs(n
+ 1) = msg end sub function GetHost(url) dim i, s GetHost = &quot;&quot;
'Strip down to host or IP address and port number, if any. if
Left(url, 7) = &quot;http://&quot; then s = Mid(url, 8) elseif
Left(url, 8) = &quot;https://&quot; then s = Mid(url, 9) end if
i = InStr(s, &quot;/&quot;) if i &gt; 1 then s = Mid(s, 1, i -
1) end if getHost = s end function function IsValidEmail(email)
dim names, name, i, c 'Check for valid syntax in an email address.
IsValidEmail = true names = Split(email, &quot;@&quot;) if UBound(names)
&lt;&gt; 1 then IsValidEmail = false exit function end if for
each name in names if Len(name) &lt;= 0 then IsValidEmail = false
exit function end if for i = 1 to Len(name) c = Lcase(Mid(name,
i, 1)) if InStr(&quot;abcdefghijklmnopqrstuvwxyz_-.&quot;, c)
&lt;= 0 and not IsNumeric(c) then IsValidEmail = false exit function
end if next if Left(name, 1) = &quot;.&quot; or Right(name, 1)
= &quot;.&quot; then IsValidEmail = false exit function end if
next if InStr(names(1), &quot;.&quot;) &lt;= 0 then IsValidEmail
= false exit function end if i = Len(names(1)) - InStrRev(names(1),
&quot;.&quot;) if i &lt;&gt; 2 and i &lt;&gt; 3 then IsValidEmail
= false exit function end if if InStr(email, &quot;..&quot;) &gt;
0 then IsValidEmail = false end if end function function FormFieldList()
dim str, i, name 'Build an array of form field names ordered as
they were received. str = &quot;&quot; for i = 1 to Request.Form.Count
for each name in Request.Form if Left(name, 1) &lt;&gt; &quot;_&quot;
and Request.Form(name) is Request.Form(i) then if str &lt;&gt;
&quot;&quot; then str = str & &quot;,&quot; end if str = str & name
exit for end if next next FormFieldList = Split(str, &quot;,&quot;)
end function function SendMail() dim mailObj dim addrList 'Send
email based on mail component. Uses global variables for parameters
'because there are so many. SendMail = &quot;&quot; 'Send email
(CDONTS version), doesn't support reply-to address and has 'no
error checking. if mailComp = &quot;CDONTS&quot; then set mailObj
= Server.CreateObject(&quot;CDONTS.NewMail&quot;) mailObj.BodyFormat
= 0 mailObj.MailFormat = 0 mailObj.From = fromAddr mailObj.To
= recipients mailObj.Subject = subject mailObj.Body = body mailObj.Send
end if 'Send email (JMail version). if mailComp = &quot;JMail&quot;
then set mailObj = Server.CreateObject(&quot;JMail.SMTPMail&quot;)
mailObj.Silent = true mailObj.ServerAddress = smtpServer mailObj.Sender
= fromAddr mailObj.ReplyTo = replyTo mailObj.Subject = subject
addrList = Split(recipients, &quot;,&quot;) for each addr in addrList
mailObj.AddRecipient Trim(addr) next mailObj.ContentType = &quot;text/html&quot;
mailObj.Body = body if not mailObj.Execute then SendMail = &quot;Email
send failed: &quot; & mailObj.ErrorMessage & &quot;.&quot; end
if end if 'Send email (ASPMail version). if mailComp = &quot;ASPMail&quot;
then set mailObj = Server.CreateObject(&quot;SMTPsvg.Mailer&quot;)
mailObj.FromAddress = fromAddr mailObj.RemoteHost = smtpServer
mailObj.ReplyTo = replyTo for each addr in Split(recipients, &quot;,&quot;)
mailObj.AddRecipient &quot;&quot;, Trim(addr) next mailObj.Subject
= subject mailObj.ContentType = &quot;text/html&quot; mailObj.BodyText
= body if not mailObj.SendMail then SendMail = &quot;Email send
failed: &quot; & mailObj.Response & &quot;.&quot; end if end if
end function %&gt;

</BODY>
</HTML>

Anon7 - 2021