📄 shangpintj.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="webconfig.asp"-->
<html>
<head>
<title><%=webname%>--商品推荐</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/css.css" rel="stylesheet" type="text/css">
<style>
td{font-size:9pt;line-height:120%;color:#353535}
body{font-size:9pt;line-height:120%}
a:link { color: #000000; text-decoration: none }
a:visited { color: #000000; text-decoration: none }
a:active { color: #000000; text-decoration: none }
a:hover { color: #336699; text-decoration: none; position: relative; right: 0px; top: 1px }
</style>
</head>
<body leftmargin="3" topmargin="4" marginwidth="00">
<%dim bookid,action
bookid=request.QueryString("id")
action=request.QueryString("action")
if action="save" then
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_books where bookid="&bookid,conn,1,1
bookname=rs("bookname")
rs.close
set rs=nothing
set rs=server.CreateObject("adodb.recordset")
rs.Open "select mailaddress,mailusername,mailuserpass,mailname,mailsend from shop_config",conn,1,1
mailaddress=rs("mailaddress")
mailusername=rs("mailusername")
mailuserpass=rs("mailuserpass")
mailname=rs("mailname")
mailsend=rs("mailsend")
rs.close
set rs=nothing
'发邮件
topic=webname &" 的商品推荐"
mailbody="<html>"
mailbody=mailbody & "<title>商品推荐</title>"
mailbody=mailbody & "<body>"
mailbody=mailbody & "<TABLE border=0 width='95%' align=center><TBODY><TR>"
mailbody=mailbody & "<TD valign=middle align=top>"
mailbody=mailbody & trim(request("friendname"))&",您好:<br><br>"
mailbody=mailbody & "您的朋友"&trim(request("myname"))&"推荐给您一款商品,请点击以下链接查看详细情况<br><br>"
mailbody=mailbody & "商品名称: <a href=http://"&weburl&"/list.asp?id="&bookid&" target=_blank>"&bookname&"</a><br><br><br>"
mailbody=mailbody & "欢迎光临: <a href=http://"&weburl&" target=_blank>"&webname&"</a><br><br><br>"
mailbody=mailbody & "</TD></TR></TBODY></TABLE><br><hr width=95% size=1>"
mailbody=mailbody & "</body>"
mailbody=mailbody & "</html>"
on error resume next
Set JMail=Server.CreateObject("JMail.Message")
JMail.Charset="gb2312"
JMail.ContentType = "text/html"
jmail.from = mailsend
jmail.silent = true
jmail.Logging = true
jmail.FromName = mailname
jmail.mailserverusername = mailusername
jmail.mailserverpassword = mailuserpass
jmail.AddRecipient request("friendemail")
jmail.body=mailbody
JMail.Subject=topic
if not jmail.Send ( mailaddress ) then
SendMail=""
else
SendMail="OK"
end if
'on error resume next
'dim JMail
'Set JMail=Server.CreateObject("JMail.SMTPMail")
'JMail.Logging=True
'JMail.Charset="gb2312"
'JMail.ContentType = "text/html"
'JMail.ServerAddress="61.145.114.64"
'JMail.Sender=webemail
'JMail.Subject=topic
'JMail.Body=mailbody
'JMail.AddRecipient request("friendemail")
'JMail.Priority=1
'JMail.Execute
'Set JMail=nothing
'if err then
'SendMail=err.description
'err.clear
'else
'SendMail="OK"
'end if
'on error resume next
'dim objCDOMail
'Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
'objCDOMail.From =webemail
'objCDOMail.To =request("friendemail")
'objCDOMail.Subject =topic
'objCDOMail.BodyFormat = 0
'objCDOMail.MailFormat = 0
'objCDOMail.Body =mailbody
'objCDOMail.Send
'Set objCDOMail = Nothing
'if err then
'SendMail=err.description
'err.clear
'else
'SendMail="OK"
'end if
if SendMail="OK" then
sendmsg="您的推荐已经成功发出!"
else
sendmsg="由于系统错误,您的推荐未能成功发送。"
end if
response.Write "<script language='javascript'>alert('"&sendmsg&"');window.close();</script>"
end if
%>
<table width="316" border="0" cellspacing="1" cellpadding="1" align="center" bgcolor="#FFCC00">
<tr>
<td bordercolor="#FFFFFF" bgcolor="#FFFFFF">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td rowspan="2">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="12v">
<tr>
<td class="12v" >
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" id="AutoNumber3" height="0" width="100%">
<tr>
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="2">
<tr>
<form name="pinglunform" method="post" action="shangpintj.asp?action=save&id=<%=bookid%>" onsubmit="return check();">
<td>
<table width="100%" border="0" cellpadding="2" cellspacing="1">
<tr align="center">
<td colspan="2" height="22"><font color="#FF0000"><b>商 品 推 荐</b></font></td>
</tr>
<tr>
<td width="29%" align="right" height="22">朋友的姓名:</td>
<td width="71%" height="22">
<input name="friendname" style="BORDER-RIGHT: #ffffff 1px groove; BORDER-TOP: #ffffff 1px groove; BORDER-LEFT: #ffffff 1px groove; COLOR: #333333; BORDER-BOTTOM: #ffffff 1px groove; HEIGHT: 18px; BACKGROUND-COLOR: #ffffff"; type="text" id="friendname" size="26">
</td>
</tr>
<tr>
<td width="29%" height="22" align="right">朋友的Email:</td>
<td width="71%" height="22">
<input name="friendemail" style="BORDER-RIGHT: #ffffff 1px groove; BORDER-TOP: #ffffff 1px groove; BORDER-LEFT: #ffffff 1px groove; COLOR: #333333; BORDER-BOTTOM: #ffffff 1px groove; HEIGHT: 18px; BACKGROUND-COLOR: #ffffff"; type="text" id="friendemail" size="26">
</td>
</tr>
<tr>
<td width="29%" align="right" height="22">您的姓名:</td>
<td width="71%" height="22">
<input name="myname" style="BORDER-RIGHT: #ffffff 1px groove; BORDER-TOP: #ffffff 1px groove; BORDER-LEFT: #ffffff 1px groove; COLOR: #333333; BORDER-BOTTOM: #ffffff 1px groove; HEIGHT: 18px; BACKGROUND-COLOR: #ffffff"; type="text" id="myname" size="26" value=<%=request.cookies("songxf")("username")%>>
</td>
</tr>
<tr>
<td colspan="2" height="25">
<div align="center">
<input name="submit" type="image" src="images/fs.gif" width="45" height="19" border="0" onFocus="this.blur()">
</div>
</td>
</tr>
</table>
</td>
</form>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<%function HTMLEncode2(fString)
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
fString = Replace(fString, CHR(10), "<BR>")
HTMLEncode2 = fString
end function%>
<script LANGUAGE="javascript">
function checkspace(checkstr) {
var str = '';
for(i = 0; i < checkstr.length; i++) {
str = str + ' ';
}
return (str == checkstr);
}
function check()
{
if(checkspace(document.pinglunform.friendname.value)) {
document.pinglunform.friendname.focus();
alert("请填写朋友的姓名!");
return false;
}
if(checkspace(document.pinglunform.friendemail.value)) {
document.pinglunform.friendemail.focus();
alert("请填写朋友的Email!");
return false;
}
if(document.pinglunform.friendemail.value.length!=0)
{
if (document.pinglunform.friendemail.value.charAt(0)=="." ||
document.pinglunform.friendemail.value.charAt(0)=="@"||
document.pinglunform.friendemail.value.indexOf('@', 0) == -1 ||
document.pinglunform.friendemail.value.indexOf('.', 0) == -1 ||
document.pinglunform.friendemail.value.lastIndexOf("@")==document.pinglunform.friendemail.value.length-1 ||
document.pinglunform.friendemail.value.lastIndexOf(".")==document.pinglunform.friendemail.value.length-1)
{
alert("请正确填写朋友的Email!");
document.pinglunform.friendemail.focus();
return false;
}
}
else
{
alert("请填写朋友的Email");
document.pinglunform.friendemail.focus();
return false;
}
if(checkspace(document.pinglunform.myname.value)) {
document.myname.mayname.focus();
alert("请填写您的姓名!");
return false;
}
}
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -