国产激情自拍_国产9色视频_丁香花在线电影小说观看 _久久久久国产精品嫩草影院

首頁 > 學院 > 開發設計 > 正文

一個免費的郵件列表源程序(一)

2019-11-18 22:27:37
字體:
來源:轉載
供稿:網友
MailToList.asp
<%@ Language=javaScript %>

<!--#include file = "include/SetGlobals.asp"-->
<!--#include file = "include/DBPath.asp"-->

<%
// output relevant meta tags
Init( "Mail to list" );

// output common top of page
Header( '<a href="work.asp">Work</a> --> Mail to list', 3 );

// output page content
Content ( );

// output common bottom of page
Footer( );
%>

<% /* standard page elements */ %>
<!--#include file = "utils/Init.asp"-->
<!--#include file = "utils/Database.asp"-->
<!--#include file = "utils/Header.asp"-->
<!--#include file = "utils/Footer.asp"-->

<%
// ============================================
// the content of this page
// ============================================
function Content ( )
{
   Out ( '<td width="20%">&nbsp;</td>' );
   Out ( '<td width="60%">' );
    
      // if the form has a passWord, validate it first
      // so that if it fails we can show the form again
      var bSubmitted = (Request.Form.Count > 0);

      // has the form been submitted?
      if ( bSubmitted )
      {
         // get the password from the form...
          sPassword = "" + Request.Form ( "password" );

         // validate the password and moan if it fails
         if ( sPassword != sDBPath )
         {
            Out ( '<h3><font color="red">Invalid password!</font></h3>' );
            // PRetend the form hasn'/t been sent yet
            bSubmitted = false;
         }
      }

      // show the form if not submitted yet
      if ( !bSubmitted )
      {
         Out ( 'In <a href="Subscribe.asp">Part 1</a> I showed you how I allowed you to subscribe to my mailing list. Here/'s where I can post an email to members of that mailing list.' );
         Out ( '<p>Strangely, I/'m not going to let you do it, but you <i>can</i> get the source code from the bottom of the page, and learn how I did it.' );
         // here's the form tag. the action attribute is the name of
         // the file that will be called with the answer - in this case
         // it's the same page. the method can be "post" to send the
         // form data 'behind the scenes' or "get" to appending the
         // data to the URL in the style page.asp?data1=a&data2=b
         //
         // use post most of the time - it's neater and "get" is limited
         // in the amount of data that can be sent.
         Out ( '<form action="MailToList.asp" method="post">' );
    
            // another table to line up the titles and inputs
            Out ( '<table border="0" cellpadding="0">' );
            Out ( '<tr><td align="right" valign="top">' );
               Out ( 'Password:' );
            Out ( '</td><td align="left" valign="top">' );
               // a simple text box. we'll reference it with the name "password"
               // and show 37 characters on the form. use the maxlength
               // attribute to set the maximum characters they can enter.
               // use value="some text" to pre-fill the input with data.
               Out ( '<input type="password" name="password" size="30"></input>' );
            Out ( '</td></tr>' );

            Out ( '<tr><td align="right" valign="top">' );
               Out ( 'Message:' );
            Out ( '</td><td align="left" valign="top">' );
               // textarea is a multiline text box. specify the size with the
               // cols and rows attributes. wrap can be "off" (the default)
               // "physical" or "virtual". as an example, consider the user
               // typing in the following text in a 40 character wide input:
               //
               // "I wonder how this text will appear to the server when I send it?"
               //
               // wrap="off" will send it as typed, but the user has to scroll off
               // to the right to see the text. (Horrid)
               //
               // wrap="physical" will physically split the line after the word
               // 'server' and send two lines to the server
               //
               // wrap="virtual" will send one line, as typed, but the user
               // will see the text nicely wrap in the input. Perfect!
               Out ( '<textarea name="message" cols="30" rows="8" wrap="physical"></textarea>' );
            Out ( '</td></tr>' );

            Out ( '<tr><td align="right" valign="top">' );
               Out ( '&nbsp;' );
            Out ( '</td><td align="left" valign="top">' );
               // type='submit" provides a submit button to perform the
               // form action. the button says "Submit" unless you override
               // with the value attribute.
               Out ( '<input type="submit" value="Send Mail"></input>' );
            Out ( '</td></tr>' );

            Out ( '</table>' );

         Out ( '</form>' );
      }
      else
      {
         // get the message from the form
         var sMessage = "" + Request.Form ( "message" );

         // open the connection
         DBInitConnection ( );

         // get the emails addresses
         var sSQL = 'SELECT Email FROM MailingList;';

         DBGetRecords ( sSQL );

         var sEmailList = "";
         var sSep = "";

         while ( !oRecordSet.EOF )
         {
            sEmailList += sSep + oRecordSet ( 0 );

            sSep = ";";

            oRecordSet.MoveNext ( );
         }

         // free the connection
         DBReleaseConnection ( );

         Email ( 'It/'s a ShawThing - what/'s new?', sEmailList, sMessage );

         Out ( '<p>Email sent successfully.<p>' );
      }

      Out ( 'Want to see how this form to mail the subscribers was done? Click below to get all the source code!' );
      Out ( '<p><center><a href="ShowSource.asp? page=MailToList"><img src="images/source.gif" border=0></a></center>' );

   Out ( '</td>' );
   Out ( '<td width="20%">&nbsp;</td>' );
}

// ============================================
// email me!
// ============================================
function Email ( sSubject, sEmail, sMessage )
{
   // send an email to the address just to confirm what just happened
   var oMail = Server.CreateObject ( "CDONTS.NewMail" );

   // setup the mail
   oMail.From = oMail.To = 'MailingList@shawthing.com';

   oMail.Bcc = sEmail;
   oMail.Importance = 1;

   oMail.Subject = sSubject;
   oMail.Body = sMessage;

   // send it
   oMail.Send ( );

   // release object
   oMail = null;
}
%>
     
utils/Database.asp
<%
// globals
var oConnection;
var oRecordSet;
var sConnection;

// ============================================
// example usage:
//      DBInitConnection ( );
//
//      var sSQL = "SELECT * FROM Somewhere";
//
//      DBGetRecords ( sSQL );
//
//      ...use oRecordSet
//
//      DBReleaseRecords ( );      // optional step
//
//      DBReleaseConnection ( );
// ============================================

// ============================================
// initializes database variables for first use on page
// ============================================
function DBInitConnection ( )
{
   // don't open it again if already opened!
   if ( sConnection != undefined )
      return;
       
   // get connection object
   oConnection = Server.CreateObject( 'ADODB.Connection' );

   // get the database connection string
   // use MapPath to make relative path into physical path
   sConnection = 'Provider=Microsoft.Jet.OLEDB.4.0; Data Source=' + Server.MapPath ( sDBPath );

   // open the connection
   oConnection.Open( sConnection );

   // as an attempt at optimization we now open
   // the recordset here, not in DBGetRecords()
   oRecordSet = Server.CreateObject ( 'ADODB.Recordset' );
}

// ============================================
// tidies up after DBInitConnection
// ============================================
function DBReleaseConnection ( )
{
   // don't release the connection if not connected!
   if ( sConnection == undefined )
      return;
       
   // as an attempt at optimization we now close
   // the recordset here, not in DBReleaseRecords()
   if ( oRecordSet.State != 0 )
      oRecordSet.Close();
   oRecordSet = undefined;

   oConnection.Close();
   oConnection = undefined;
    
   sConnection = undefined;
}

// ============================================
// executes the passed in SQL statement
// and returns the oRecordSet object
// ============================================
function DBGetRecords ( sSQL )
{
   // remember that this can fail if passed garbage, and hence
   // 'oRecordSet' will already be 'closed'
   oRecordSet = oConnection.Execute( sSQL );
}

// ============================================
// tidies up after DBGetRecords
// ============================================
function DBReleaseRecords ( )
{
   // IMPORTANT: THIS FUNCTION INTENTIONALLY BLANK
   // as an attempt at optimization we now open/close
   // the recordset with the connection, not separately
   // so all code was moved to DBReleaseConnection.
    
   // it is recommended that you still call this function as soon
   // as the recordset is finished with.
    
   // note that it is assumed by the caller that it is legal
   // to call DBReleaseConnection without calling this function
}
%>


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
国产激情自拍_国产9色视频_丁香花在线电影小说观看 _久久久久国产精品嫩草影院
国产免费黄网站| 日本不卡视频一区二区| 中文字幕免费中文| av中文字幕在线看| 久草电影在线| 天天av天天爽| 精品精品导航| 久久av少妇| 国产日本在线视频| 亚洲精品国自产拍在线观看| 白浆爆出在线观看| 久久综合精品视频| 五月综合激情在线| 亚洲最新永久观看在线| 中文字幕麻豆| 久久国产热视频| 91涩漫在线观看c| 男女午夜视频在线观看| 女同一区二区免费aⅴ| 国产亚洲精品一区二区在线观看 | 中文字幕欧美日韩在线不卡| 国产精品bbw一区二区三区| 午夜亚洲成人| 91久久麻豆| 国产网站观看9久| 青青草原国产在线观看| 国产成人亚洲欧美电影| 五月婷婷导航| 激情综合丁香| 天天插天天色| 亚洲伊人网在线观看| 国产麻豆高清视频在线第一页| 国产成人亚洲欧美电影| 麻豆精品不卡国产免费看| 午夜视频99| 九九热在线视频观看| 在线观看的网站你懂的| 国产98在线| 国产www网站| 97高清视频| 国产l精品国产亚洲区在线观看| √天堂8资源中文在线| 天堂中文资源在线| 最新av免费看| 国产蜜臀在线| 午夜视频99| 99色在线视频| 国产成人高清精品| 精品福利视频导航大全| www.九九热.com| 久热国产在线视频| 最近中文字幕mv免费高清在线| 国产秒拍福利视频露脸| 国产字幕在线看| 国产丝袜视频在线播放| 精品视频一二区| 色中文字幕在线| 国内精品不卡| 国产9色视频| 欧美韩日国产| 国产丝袜自拍| 亚洲国产精品区| 综合激情亚洲| 伊人中文字幕在线| 国产自产视频| 精品欧美不卡一区二区在线观看| 亚洲人在线播放| 大香伊人久久| 在线久久视频| 天天操天天操一操| 天堂中文在线观看| 国产欧美黑人| 久久国产情侣| 香蕉视频在线看| 国产精品久久久久久精| 九色福利视频| 国产黄色大片在线观看| 黄色网址在线免费播放| 亚洲欧美日韩综合精品网| 九九热视频免费在线观看| 国产二区三区在线| 国产精品㊣新片速递bt| 欧美黑人乱大交| 在线国产91| 精品国产白色丝袜高跟鞋| 国产精品视频流白浆免费视频| 日本在线观看网站| 国产h在线观看| 国产香蕉在线| 国产在线传媒| 九九热在线观看视频| av激情在线| 精品女厕厕露p撒尿| 国产高清视频在线| 国产天堂在线播放视频| 国产乱精品一区二区三区| 狠狠干婷婷色| 国产裸舞福利在线视频合集 | eeuss影院网站免费观看| 国产亚洲精品拍拍拍拍拍| 狠狠操视频网| 国产美女自拍视频| 国产麻豆精品视频一区二区| 国产美女极品在线| www在线视频| 牛牛精品视频在线| 久草.com| 久热久精久品这里在线观看| 亚洲视频在线网| av在线播放网| 久热中文字幕| 午夜在线小视频| 18av在线视频| 亚洲视频在线观看不卡| 亚洲精品白浆| 国产综合视频一区二区三区免费| 黄色片视频在线观看| 中文字幕在线免费观看| 国产a级网站| 亚洲男人的天堂成人| jlzzjlzz欧美大全| √天堂资源地址在线官网| 国产福利片在线| sese一区| 高清av中文在线字幕观看1| 国产欧美在线观看视频| 亚洲国产日韩成人综合天堂| 老司机精品视频一区二区| 国产鲁鲁视频在线观看免费| 9999在线视频| 国产一区在线视频观看| 国产黄色免费网站| 麻豆av在线| 在线观看av网站永久| 欧美日韩视频精品二区| 国产精品伦理一区二区三区| 人人澡人人爽| 91极品在线| 国产无套粉嫩白浆在线2022年| 亚洲国产日韩在线人成电影| 午夜av在线免费观看| 欧美视频免费一区二区三区| 精品国产一区二区三区不卡在线| 国产在线观看色| 日本一卡二卡四卡精品| 精品视频vs精品视频| 国产一卡二卡3卡4卡四卡在线| 午夜影院在线免费观看| 精品偷拍激情视频在线观看| 成在在线免费视频| 老司机精品视频一区二区| 亚洲videos| 在线视频色在线| 99久久国产视频| 777电影在线观看| 国产精品入口麻豆免费| 国产中文在线观看| 九九99九九精彩| 高清在线观看av| 国产中文字幕在线| 国产在线高清理伦片a| 超碰在线中文| www在线视频| 青青草视频在线免费观看| 在线免费观看你懂的| 精品一区二区三区在线成人| 国产黄色av免费看| 精品久久av| av一级在线| 秋霞av在线| 国产美女福利在线| 国产视频精品久久| 91涩漫在线观看c| 一区免费观看| 青青草视频免费在线观看| 免费观看一二区视频网站| 国产在线激情视频| 国产羞羞视频在线观看| 国产黄在线观看| 性国产高清在线观看| 男人天堂亚洲| 国产精品臀控福利在线观看| 国产福利小视频在线| 亚洲男人网站| 天天av天天爽| 亚洲精品视频区| 超碰在线网站| 国产福利图片| 免费99热在线观看| 国产区成人精品视频| 日韩黄色成人| 国产视频福利| 久草一本av| 日韩中文字幕久久久经典网| 五月综合网站| 精品视频vs精品视频| 中文字幕免费在线视频| 亚洲大香人伊一本线| 国产精品美女视频免费观看软件 | 国产一级黄色电影|