📄 sendmail.asp
字号:
<!--#include file="../Conn.asp"-->
<!--#include file="../SysCls/KS_CommonCls.asp"-->
<%
'===================================================================================================================
'软件名称:科汛网站管理系统
'当前版本:科汛网站管理系统 V2.2 SP2 Free
'Copyright (C) 2006-2008 Kesion.Com All rights reserved.
'产品咨询QQ:9537636,41904294
'技术支持QQ:111394,54004407
'程序版权:科汛网络
'程序开发:科汛网络开发组(总策划:林文仲)
'E-Mail :kesioncms@hotmail.com webmaster@kesion.com
'官方网站:http://www.kesion.com
'演示站点:http://test.kesion.com
'郑重声明:
' ①、免费版本请在程序首页保留版权信息,并做上本站LOGO友情连接,商业版本无此要求;
' ②、任何个人或组织不得在授权允许的情况下删除、修改、拷贝本软件及其他副本上一切关于版权的信息;
' ③、科汛网络保留此软件的法律追究权利
'===================================================================================================================
Dim KSCMS
Set KSCMS=New COMMONCls
Dim ArticleID,RS,RSConfig,ArticleUrl,WebName,WebUrl
Dim ReturnInfo,Subject,MyName,MyMail,FrName,FrMail,MailBody
ArticleID=KSCMS.G("ArticleID")
ArticleUrl=Request.ServerVariables("HTTP_REFERER")
if ArticleID="" then
Response.Write"<script>alert(""错误的参数!"");location.href=""javascript:history.back()"";</script>"
Response.End
end if
Set RS=Server.CreateObject("Adodb.Recordset")
RS.Open "Select * From KS_Article Where NewsID='" & ArticleID & "'",conn,1,1
IF RS.EOF And RS.BoF Then
RS.CLOSE
SET RS=NOthing
Call KSCMS.CloseConn
Set KSCMS=Nothing
Response.Write"<script>alert(""错误的参数!"");location.href=""javascript:history.back()"";</script>"
Response.End
End if
Set RSConfig=Conn.Execute("Select WebName,WebUrl From KS_Config")
WebName=RSConfig(0)
WebUrl=RSConfig(1)
MailServerAddress=KSCMS.GetConfig("MailServer")
RSConfig.close
set RSConfig=nothing
IF KSCMS.G("Action")="Send" Then
FrName=Trim(KSCMS.G("FrName"))
MyName=Trim(KSCMS.G("MyName"))
FrMail=Trim(KSCMS.G("FrMail"))
IF FrMail="" Then
Response.Write"<script>alert(""好友邮箱地址不能为空!"");location.href=""javascript:history.back()"";</script>"
Response.End
End IF
IF KSCMS.IsValidEmail(FrMail)=false then
Response.Write"<script>alert(""好友邮箱地址格式有误!" & FrMail & """);location.href=""javascript:history.back()"";</script>"
Response.End
End if
MyMail=KSCMS.G("MyMail")
IF MyMail="" Then
Response.Write"<script>alert(""您的邮箱地址不能为空!"");location.href=""javascript:history.back()"";</script>"
Response.End
End IF
if KSCMS.IsValidEmail(MyMail)=false then
Response.Write"<script>alert(""您的邮箱地址格式有误!"");location.href=""javascript:history.back()"";</script>"
Response.End
End if
Content=KSCMS.G("Content")
Subject="您好," & KSCMS.G("FrName") & "您的朋友"&KSCMS.G("MyName")&"从" & KSCMS.G("SiteName") & "给您发来的一篇信息资料"
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>"
MailBody=MailBody &"<TABLE border='0' width='90%' align='center'><TBODY><TR>"
MailBody=MailBody &"<TD valign='middle' align='top'>"
MailBody=MailBody &KSCMS.G("Contnet") & "<br>以下是信息正文<br>" & RS("ArticleContent")
MailBody=MailBody &"</TD></TR></TBODY></TABLE>"
'开始发送
ReturnInfo=KSCMS.SendMail(MailServerAddress,"","",Subject,FrMail,KSCMS.G("MyName"),MailBody,MyMail)
IF ReturnInfo="OK" Then
Response.Write ("<script>alert('信件成功发送!');window.close();</script>")
Response.End
Else
Response.Write ("<script>alert('信件发送失败!失败原因:\n" & ReturnInfo & "');window.close();</script>")
Response.End
End if
End if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>发送电子邮件</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<link href="/Skin/style.css" rel="stylesheet">
<body>
<table width="770" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td><table width="60%" border="0" align="center" cellpadding="0" cellspacing="1">
<tr bgcolor="#FFFFFF">
<td width="107" height="30" align="center"> 好友姓名:</td>
<td width="345" height="30"><input name="FrName" type="text" id="FrName" size="15" maxlength="20" /></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="29" align="center">好友邮箱:</td>
<td height="30"><input name="FrMail" type="text" id="FrMail" maxlength="50" /></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="29" align="center">您的姓名:</td>
<td height="30"><input name="MyName" type="text" id="MyName" size="15" maxlength="20" /></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="26" align="center">您的邮箱:</td>
<td height="30"><input name="MyMail" type="text" id="MyMail" /></td>
</tr>
<tr align="center" bgcolor="#FFFFFF">
<td height="23" colspan="2" > 邮件内容</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="56" colspan="2"><br />
您好!<br />
我在<a href="<%=WebUrl%>" target="_blank">[<%=WebName%>]</a>上看到一篇标题为<font color="#FF0000"><%=RS("Title")%></font>的信息,希望能对您有所帮助。<br />
网址为:<a href="<%=ArticleUrl%>" target="_blank"><%=ArticleUrl%></a><br />
<input name="Content" type="hidden" id="Content" value="<br>您好!<br>我在<a href=<%=WebUrl%> target=_blank>[<%=WebName%>]</a>上看到一篇标题为<font color=#FF0000><%=RS("Title")%></font>的信息,希望能对您有所帮助。<br>网址为:<a href=<%=ArticleUrl%> target=_blank><%=ArticleUrl%></a><br>" />
</td>
</tr>
<tr align="center" bgcolor="#FFFFFF">
<td height="28" colspan="2"><input type="hidden" value="<%=WebName%>" name="SiteName">
<input type="hidden" name="ArticleID" value="<%=ArticleID%>">
<input type="submit" name="Submit" class="fmbtn" value="发 送 邮 件" /></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -