?? sendmail.asp
字號:
<!--#include file="config.asp" -->
<!--#include file="../inc/Email.asp" -->
<!--#include file="../inc/chkinput.asp" -->
<%
Dim NewCloud_Ads
Dim Rs
Dim SQL
Dim NowStats
Dim HtmlTitle
Dim Style_CSS
Dim HtmlTempStr
Dim TempTopStr
Dim TempFootStr
Dim boardtype
Dim FoundErr
Dim ErrMsg
Dim ID
Dim SucMsg
Dim topic
Dim mailbody
Dim announce
Dim useremail
ArticlEndMail
CloseConn
Public Sub ArticlEndMail()
On Error Resume Next
Newasp.LoadTemplates ("")
Set NewCloud_Ads = Server.CreateObject("NewCloudAsp.Admin_Adcolumn")
Set Rs = Server.CreateObject("adodb.recordset")
NowStats = "郵件打包發送"
HtmlTitle = "郵件打包發送"
TempTopStr = Newasp.mainhtml(0) & Newasp.mainhtml(1) & Newasp.mainhtml(2) & Newasp.mainhtml(3)
TempFootStr = Newasp.mainhtml(4)
Style_CSS = Replace(Replace(Newasp.Style_CSS, "{$SetupDir}", Newasp.SetupDir), "{$PicUrl}", Newasp.TempDir)
HtmlTempStr = TempTopStr
HtmlTempStr = Replace(HtmlTempStr, "{$NavMenu}", Newasp.SortingMenu)
HtmlTempStr = Replace(HtmlTempStr, "{$Width}", Newasp.mainset(0))
HtmlTempStr = Replace(HtmlTempStr, "{$Style_CSS}", Style_CSS)
If CInt(Newasp.Setting(5)) = 0 Then
HtmlTempStr = Replace(HtmlTempStr, "{$TopMeun}", Newasp.mainset(9))
Else
HtmlTempStr = Replace(HtmlTempStr, "{$TopMeun}", Newasp.mainset(10))
End If
HtmlTempStr = Replace(HtmlTempStr, "{$NowStats}", NowStats)
HtmlTempStr = Replace(HtmlTempStr, "{$Title}", HtmlTitle)
HtmlTempStr = Replace(HtmlTempStr, "{$Adcolumn(0)}", NewCloud_Ads.RunScriptAds(7))
HtmlTempStr = Replace(HtmlTempStr, "{$Adcolumn(1)}", NewCloud_Ads.BannerAds(7))
HtmlTempStr = Replace(HtmlTempStr, "{$Adcolumn(2)}", NewCloud_Ads.AdsColumn(7, 2))
HtmlTempStr = Replace(HtmlTempStr, "{$Adcolumn(3)}", NewCloud_Ads.AdsColumn(7, 3))
Response.Write HtmlTempStr
TempFootStr = Replace(TempFootStr, "{$FootMeun}", Newasp.mainset(11))
TempFootStr = Replace(TempFootStr, "{$Width}", Newasp.mainset(0))
TempFootStr = Replace(TempFootStr, "{$Adcolumn(4)}", NewCloud_Ads.ScriptFloatAds(7))
TempFootStr = Replace(TempFootStr, "{$Adcolumn(5)}", NewCloud_Ads.ScriptFixedAds(7))
Response.Write "<table width="""
Response.Write Newasp.mainset(0)
Response.Write """ class=TableBorder border=""0"" align=""center"" cellpadding=""0"" cellspacing=""1"" class=""Border"">"
Response.Write " <tr> "
Response.Write " <th>郵件打包發送</th>"
Response.Write " </tr>"
Response.Write " <tr> "
Response.Write " <td valign=""top"" class=Border2><BR>"
FoundErr = False
ID = CLng(Request("ID"))
If Not IsNumeric(ID) And ID<>"" then
Response.write"錯誤的系統參數!ID必須是數字"
Exit Sub
Response.End
End If
If ID = "" Then
FoundErr = True
ErrMsg = ErrMsg + "<br>" + "<li>請指定相關文章</li>"
Exit Sub
End If
Set Rs = Server.CreateObject("adodb.recordset")
If FoundErr Then
Call errormsg
Else
Call showPage
End If
Response.Write "<BR>"
Response.Write " </td>"
Response.Write " </tr>"
Response.Write "</table>"
Response.Write TempFootStr
Set NewCloud_Ads = Nothing
End Sub
Private Sub showPage()
On Error Resume Next
If FoundErr Then
Call errormsg
Else
If Request("action") = "sendmail" Then
If IsValidEmail(Trim(Request.Form("mail"))) = False Then
ErrMsg = ErrMsg + "<br>" + "<li>您的Email有錯誤!</li>"
FoundErr = True
Else
useremail = Trim(Request.Form("mail"))
End If
If SendMail = "OK" Then
Call success
End If
Call announceinfo
If FoundErr Then
Call errormsg
Else
Call success
End If
Else
Call pag
End If
End If
If Err.Number <> 0 Then Err.Clear
End Sub
Private Sub announceinfo()
topic = "您從" & Newasp.Setting(0) & "發來的文章資料"
mailbody = mailbody & "<style>A:visited { TEXT-DECORATION: none }"
mailbody = mailbody & "A:active { TEXT-DECORATION: none }"
mailbody = mailbody & "A:hover { TEXT-DECORATION: underline overline }"
mailbody = mailbody & "A:link { text-decoration: none;}"
mailbody = mailbody & "A:visited { text-decoration: none;}"
mailbody = mailbody & "A:active { TEXT-DECORATION: none;}"
mailbody = mailbody & "A:hover { TEXT-DECORATION: underline overline}"
mailbody = mailbody & "BODY { FONT-FAMILY: 宋體; FONT-SIZE: 9pt;}"
mailbody = mailbody & "TD { FONT-FAMILY: 宋體; FONT-SIZE: 9pt }</style>"
Rs.Open "Select title,content,infotime,writer from NC_Article where id=" & ID & "", conn, 1, 1
If Rs.bof And Rs.Eof Then
FoundErr = True
ErrMsg = ErrMsg + "<br>" + "<li>沒有有找到相關文章</li>"
Else
announce = announce & "<TABLE border=0 width='95%' align=center><TBODY><TR>"
announce = announce & "<TD valign=middle align=top>"
announce = announce & "-- 作者:" & Rs("writer") & "<br>"
announce = announce & "-- 發布時間:" & Rs("infotime") & "<br><br>"
announce = announce & "-- " & Rs("title") & "<br>"
announce = announce & "" & Rs("content") & ""
announce = announce & "<hr></TD></TR></TBODY></TABLE>"
End If
Rs.Close
mailbody = mailbody + announce
mailbody = mailbody & "<center><a href=http://www.Newasp.net>新云網絡</a>"
Select Case CInt(Newasp.Setting(10))
Case 0
SucMsg = SucMsg + "對不起!系統未開啟郵件功能。"
Case 1
Call Jmail(useremail, topic, mailbody)
Case 2
Call Cdonts(useremail, topic, mailbody)
Case 3
Call aspemail(useremail, topic, mailbody)
Case Else
SucMsg = SucMsg + "系統未開啟郵件功能,請記住您的注冊信息。"
End Select
If SendMail = "OK" Then
SucMsg = SucMsg + "恭喜您,您的打包郵遞發送成功。"
Else
SucMsg = SucMsg + "由于系統錯誤,您的打包郵遞發送未成功。"
End If
End Sub
Private Sub pag()
Response.Write "<table cellpadding=0 cellspacing=0 border=0 width=460 class=""Border"" align=center>"
Response.Write " <tr>"
Response.Write " <td class=Border2>"
Response.Write " <table cellpadding=6 cellspacing=1 bgColor=#CECECE border=0 width=""100%"">"
Response.Write " <form action=""sendmail.asp?action=sendmail&id="
Response.Write ID
Response.Write """ method=post>"
Response.Write " <tr>"
Response.Write " <th valign=middle colspan=2 align=center>"
Response.Write " <b>打包郵遞</b></th></tr>"
Response.Write " <tr>"
Response.Write " <td class=Border2 valign=middle colspan=2>"
Response.Write " <b>把本文打包郵遞。</b><br>請正確輸入你要郵遞的郵件地址!"
Response.Write " </td></tr><tr>"
Response.Write " <td class=Border2><b>郵遞的 Email 地址:</b></td>"
Response.Write " <td class=Border2><input type=text size=40 name=""mail""></td>"
Response.Write " </tr><tr>"
Response.Write " <td colspan=2 class=Border2 align=center><input type=submit value=""發 送"" name=""Submit""></table></td></form></tr></table>"
End Sub
Private Sub success()
Response.Write " <table cellpadding=0 cellspacing=1 border=0 bgColor=#CECECE width=460 align=center>"
Response.Write " <tr>"
Response.Write " <td class=""Border2"">"
Response.Write " <table cellpadding=3 cellspacing=1 border=0 width=""100%"">"
Response.Write " <tr align=""center""> "
Response.Write " <th width=""100%"">成功:打包郵遞</th>"
Response.Write " </tr>"
Response.Write " <tr> "
Response.Write " <td width=""100%"" class=""Border2"">"
Response.Write SucMsg
Response.Write " </td>"
Response.Write " </tr>"
Response.Write " <tr align=""center""> "
Response.Write " <td width=""100%"" class=""Border1"">"
Response.Write "<a href=""javascript:history.go(-1)""> << 返回上一頁</a>"
Response.Write " </td>"
Response.Write " </tr> "
Response.Write " </table> </td></tr></table>"
End Sub
Private Sub errormsg()
Response.Write "<br>"
Response.Write " <table cellpadding=0 cellspacing=1 border=0 width=65% bgColor=#CECECE align=center>"
Response.Write " <tr>"
Response.Write " <td class=""Border2"">"
Response.Write " <table cellpadding=3 cellspacing=1 border=0 width=""100%"">"
Response.Write " <tr align=""center""> "
Response.Write " <th>錯誤信息</th>"
Response.Write " </tr>"
Response.Write " <tr> "
Response.Write " <td width=""100%"" class=""Border2""><b>產生錯誤的可能原因:</b><br><br>"
Response.Write ErrMsg
Response.Write " </td>"
Response.Write " </tr>"
Response.Write " <tr align=""center""> "
Response.Write " <td width=""100%"" class=""Border1"">"
Response.Write "<a href=""javascript:history.go(-1)""> << 返回上一頁</a>"
Response.Write " </td>"
Response.Write " </tr> "
Response.Write " </table> </td></tr></table>"
End Sub
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -