邮件发送当前页面

来源:岁月联盟 编辑:zhuzhu 时间:2005-09-30
<!--#Include file="inc_config.asp"-->
<html>
<head>
<title>:: www.wedexpo.com ::</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript" type="text/JavaScript">
<!--



function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>

<style type="text/css">
<!--
td {
color: #000000;
font-size: 14px;
font-family: "黑体";
}
.T18 {
font-family: "黑体";
font-size: 18px;
}/* 18号黑体字 */
-->
</style>
</head>


<body leftmargin="0" topmargin="0" >

<%

mail_address=trim(request.form("mail_address"))

if mail_address<>"" then

Function GetURL(url)
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "GET", url, False, "", ""
.Send
'GetURL = .ResponseText
GetURL = .Responsebody
End With
Set Retrieval = Nothing
End Function

Function bytes2BSTR(vIn)
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
bytes2BSTR = strReturn
End Function
'-------读出要发送的文件内容Start
data_url="http://"&Request.ServerVariables ("SERVER_NAME")&Request.ServerVariables ("url")&"?"&Request.ServerVariables ("QUERY_STRING")

T=GetURL(Data_url)
msg=bytes2BSTR(T) '将数据转换为字符型式

'-------读出要发送的文件内容End
User_Pj_array=split(mail_address,",")
for pp=0 to ubound(User_PJ_array)
if trim(User_PJ_array(pp))<>"" then
sender="server@ewedexpo.com"
mailto=trim(User_PJ_array(pp))
' mailto="lzppcc@asiaeastern.net"
subject="您朋友从Wedexpo网站发出的的产品推荐信!"
'----处理网址Start
msg=replace(lcase(msg),"src=""/","src=""http://"&Request.ServerVariables ("SERVER_NAME")&"/")
msg=replace(lcase(msg),"src=""../images/","src=""http://"&Request.ServerVariables ("SERVER_NAME")&"/chinese/vip_show/images/")
'----处理网址End
call jmail_Send(sender,mailto,subject,msg)

end if
next
%>
<script language="JavaScript">
alert ('发送成功!');
self.close();
</script>
<%
response.end
end if


   ProductCatID=clng(request.querystring("ProductCatID")) '---读出产品类别
   ProductID=clng(request.querystring("ProductID")) '--产品ID
   if ProductCatID="" or ProductID="" then
   response.write "产品类别不正确!"
   response.end
   end if
   Product_Cat_ID=ProductCatID '---读出产品类别
   setPage=request.querystring("setPage") '---读出分页数
   key_txt=Big2Gb(request.querystring("key_txt")) '---读出搜索关键字
   S_Price=request.querystring("S_Price") '----读出开始价格
   E_Price=request.querystring("E_Price") '----读出结束价格



if setPage="" then setPage=10 '---设定置认分页数


'----生成sql语句Start
sql="select * From Product where IS_Del=0 "
  
  if key_txt<>"" then   '---判断查询文字
  sql=sql&" and ProductCName like '%"&key_txt&"%' "
  end if
  
if s_price<>"" and E_Price<>"" then
  if isnumeric(S_Price) and isnumeric(E_Price) then
   sql=sql&" and (ProductPrice>="&s_Price&" and ProductPrice<="&E_Price&") and Disp_Price=1 "
  end if
end if



if ProductID<>"" then
sql=sql&" and ProductID='"&ProductID&"'"
end if
sql=sql&" order by Top_up,ProductCatID,ShowOrder"
'----生成sql语句End
'response.write sql
'response.end
set rs=conn.execute(sql)

'response.write sql
'response.end
if rs.eof then

      response.write("<table  width='96%' border='0' cellspacing='0' cellpadding='0' align='center'>")
      response.write("<tr bgcolor=#f6f6f6 ><td colspan='7'><center>暂无记录</center></td></tr>")
      response.write("</table>")   
   else

'----读出发布公司信息Start
  sql="select CompCName,(Select CName From  [asiaeastern].[dbo].S_Nation where NationID=Member.Country) as Country,(Select CName From  [asiaeastern].[dbo].S_PROVINCE where PROVINCEID=Member.province) as Province,(Select xText  FROM [asiaeastern].[dbo].[SetColumnValue]  where Columnkey='CompType' and xValue=Member.CompType) AS CompType,MemberStar from Member Where MemberID='"&rs("memberID")&"'"
  set rs3=conn.execute(sql)
  if rs3.eof then
   C_name="" '-公司名称
   C_City="" '-公司所在城市
   C_type="" '-公司类型
   
  else
   C_Name=rs3(0)
   C_City=rs3(1)&"."&rs3(2)
   C_Type=rs3(3)
   MemberStar=rs3(4)
  end if
  rs3.close
  set rs3=nothing
  
'----读出发布公司信息End

     '---产品自带配件 By Michael 2002/8/30
 SQLCom = "Select ItemID,ItemCName,ItemEName,ItemNum from Product_Fitting Where ProductID = "& ProductID
 Set Fitting_rs = Conn.execute(SQLCom)

 '---Select Product_Specification_Unit
 sql="Select * from Product_Specification_Unit where Is_del=0 and UnItType=0 and ProductID="&ProductID&" order by UnitShowOrder"
 set Sp_rs=conn.execute(sql)

 '---Select Product_Specification_Unit
 sql="Select * from Product_Specification_Unit where Is_del=0 and UnItType=1 and ProductID="&ProductID&" order by UnitShowOrder"
 set Fit_rs=conn.execute(sql)

%>
<table width="90%" border="0" align="center" cellpadding="10" cellspacing="0">
  <tr>
    <td width="506" valign="top"><img src="../images/logo.gif" width="343" height="52"></td>
    <td width="174" valign="top"><img src="../images/logo_vip_print.gif" width="190" height="60"></td>
  </tr>
</table>
<table width="90%" border="0" align="center" cellpadding="10" cellspacing="0">
<form action="" method="post">
  <tr>
    <td width="35%" valign="top" class="T18">请输入要转寄的邮件地址: </td>
    <td width="65%" valign="top" class="T18"><input type="text" name="mail_address"><br>
       <input type="button" value="增加邮件地址" name=AddVRFile class=cbutton OnClick="AddVRFileInput('')">
      <br>
      <input type="submit" name="Submit" value="发送"></td>
  </tr>
</form>
</table>
<table width="90%" border="0" align="center" cellpadding="10" cellspacing="0">
  <tr>
    <td valign="top" class="T18"><%=C_name%>__产品橱窗</td>
  </tr>
</table>
<hr align="center" width="90%" size="1">
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="100%">

                 <% If Not (IsNull(rs("ProductImage")) or rs("ProductImage") = "") Then %>
                <IMG  src="/Public/Product/<%=rs("ProductImage")%>" border=0 alt="请点击查看大图" onClick="MM_openBrWindow('/chinese/products/openwindow.asp?ProductID=<%=rs("productID")%>','opwin','scrollbars=yes,width=650,height=650')" style="cursor:hand;">
                <%end if%>
    </td>
  </tr>
</table>
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30"><span class="title"><font color="#B76700"><strong>&nbsp;</strong></font><strong>产品名:<%=rs("productCname")%></strong></span>
    </td>
  </tr>
  <tr>
    <td valign="bottom"><hr size="1"></td>
  </tr>
</table>
<table width="90%" border="0" align="center" cellpadding="8" cellspacing="0">
  <tr>
    <td width="17%">原产品编号</td>
    <td width="83%"><%=rs("MemberProductNo")%></td>
  </tr>
  <tr bgcolor="#f6f6f6">
    <td>中文名称:</td>
    <td><%=rs("productCname")%></td>
  </tr>
  <tr>
    <td>英文名称:</td>
    <td><%=rs("productEname")%></td>
  </tr>
<%
'----Disp_ Product_Specification_Unit Table
back_line=0
do while not Sp_rs.eof

if back_line/2=int(back_line/2) then
back_group="background=""images/textBack_2.gif"""
else
back_Group=""
end if
  sql="select * from Product_Specification_Item where Is_del=0 and UnitID="&Sp_rs("UnitID")&" order by ItemShowOrder"
  set rs5=conn.execute(sql)
  if not rs5.eof then
%>
  <tr bgcolor="#f6f6f6">
    <td><%
response.write sp_rs("UnitCName")
 %>
</td>
    <td>
<%
  do while not rs5.eof
   response.write rs5("ItemCName")&","
  rs5.movenext
  loop
  rs5.close
  set rs5=nothing
%>
</td>
              </tr>

        <%
end if
back_line=back_line+1
sp_rs.movenext
loop
sp_rs.close
set sp_rs=nothing

do while not Fit_rs.eof
if back_line/2=int(back_line/2) then
back_group="background=""images/textBack_2.gif"""
else
back_Group=""
end if
sql="select * from Product_Specification_Item where Is_del=0 and UnitID="&Fit_rs("UnitID")&" order by ItemShowOrder"
  set rs5=conn.execute(sql)
if not rs5.eof then
%>
  <tr bgcolor="#f6f6f6">
    <td><%response.write Fit_Rs("UnitCName")%> 配件
</td>
                <td>
 <%
  do while not rs5.eof
    response.write rs5("ItemCName")&","
  rs5.movenext
  loop
  rs5.close
  set rs5=nothing
%>
</td>
              </tr>
        <%
end if
back_line=back_line+1
Fit_rs.movenext
loop
Fit_rs.close
set Fit_rs=nothing
%>   
        <%if rs("Disp_Price")=1 and isnumeric(Rs("ProductPrice")) then%>
  <tr bgcolor="#f6f6f6">
    <td>产品价格</td>
                <td><%=Rs("ProductPrice")%></td>
              </tr>
<%End if%>

<%if list_html(Rs("Remarks"))<>"" then%>
  <tr bgcolor="#f6f6f6">
    <td>产品简介</td>
                <td><%=list_html(Rs("Remarks"))%></td>
              </tr>

<%End if%>

  <tr>
    <td height="20" colspan="2">
<%

UnitID=rs("Presentation_ID")

'---判断是否存在介绍
if isnumeric(UnitID) then
  SQLCom = "SELECT * FROM BulletinContent Where UnitID = "& UnitID &" Order By Position"
SET RSCom = conn.execute(SQLCom)
 If Not rscom.EOF Then
    DIVCount = 0
            Do while not rscom.EOF
       DIVCount = DIVCount + 1
       ImageHTELSrc = ""
       ClientCk = "N"
       comm = rscom("Content")
       ncomm = list_html(comm)
       If Not (rscom("ImageFile") = "" or IsNull(rscom("ImageFile"))) Then ImageHTELSrc = "<img src="""& session("Public") & rscom("ImageFile") &""" border=0 align="& rscom("ImageWay") &" id=conimg"& rscom("Position") &" alt=""第 "& rscom("Position") &" 段图片"">"
       response.write "<table width=""100%""><tr><td>"&ImageHTELSrc & ncomm &"</td></tr></table><br>"& vbcrlf
       rscom.movenext
            loop
         End If %> <br> <%  SQLFile = "Select * FROM BulletinFileUp Where UnitID = "& UnitID
     Set RSFile = Conn.execute(SQLFile)
        If Not RSFile.EOF Then %> <table border="0" width="100%" cellspacing="1" cellpadding="3" class="c12-1" bgcolor="#FFFFFF">
        <tr>
          <td width="10%" align="right" valign="top">附档:</td>
          <td width="90%"> <% Do while not RSFile.EOF
              response.write FileCk(RSFile("NFileName"),RSFile("OFileName"))
             RSFile.movenext
     Loop %>
 
 </td>
        </tr>
      </table>
    <%  
end if
End IF %> 
</td>
  </tr>
</table>
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30"><span class="title"><font color="#B76700"><strong>&nbsp;</strong></font><strong>联系方式</strong></span>
    </td>
  </tr>
  <tr>
    <td valign="bottom"><hr size="1"></td>
  </tr>
</table>
<table width="90%" border="0" align="center" cellpadding="6" cellspacing="0">
  <tr>
    <td width="120">地址:</td>
    <td width="641"><%=C_Address%></td>
  </tr>
  <tr>
    <td>电话:</td>
    <td><span><font face="Arial, Helvetica, sans-serif"><%=C_Tel%></font></span></td>
  </tr>
  <tr>
    <td>传真:</td>
    <td><span><font face="Arial, Helvetica, sans-serif"><%=C_fax%></font></span></td>
  </tr>
  <tr>
    <td><span class="worden"><font face="Arial, Helvetica, sans-serif">E-mail:</font></span>&nbsp;</td>
    <td><span class="worden"><a href="mailto:<%=C_Mail%>?subject=来自精品展示厅" target="_blank"><font face="Arial, Helvetica, sans-serif"><%=C_Mail%></font></a></span><font face="Arial, Helvetica, sans-serif">&nbsp;</font>&nbsp;&nbsp;</td>
  </tr>
  <tr>
    <td>网址:</td>
    <td><a href="<%=C_Home%>" target="_blank"><font face="Arial, Helvetica, sans-serif"><%=C_Home%></font></a></td>
  </tr>
</table>
<hr align="center" width="90%" size="1">
<table width="90%" border="0" align="center" cellpadding="10" cellspacing="0">
  <tr>
    <td align="right"><a href="javascript:self.print();">立即打印</a> &nbsp;&nbsp;<a href="javascript:self.close();">关闭窗口</a></td>
  </tr>
</table>
<%
end if
%>
<script language="VBScript">
NowVRFileInputNo = 1
NowVRFileInputCount = 0
Sub AddVRFileInput(add_txt)
  If NowVRFileInputCount < 10 Then
   HTMLSrc = "<table border=0 cellspacing=0 cellpadding=0 Id=VRFileInput"& NowVRFileInputNo &">"& vbcrlf
   HTMLSrc = HTMLSrc & "<tr><td>" & vbcrlf

   HTMLSrc = HTMLSrc & "<input type=""txt"" name=""mail_address"" value=""""><input type=button value=删除 class=cbutton OnClick=""DelVRFileInput("& NowVRFileInputNo &")"">" & vbcrlf
   HTMLSrc = HTMLSrc & "</td></tr>" & vbcrlf
   HTMLSrc = HTMLSrc & "</table>" & vbcrlf
   document.all.AddVRFile.InsertAdjacentHTML "beforeBegin", HTMLSrc
   NowVRFileInputNo = NowVRFileInputNo + 1
   NowVRFileInputCount = NowVRFileInputCount + 1
  Else
   Alert "评价太多了吧..."
  End IF
End Sub

Sub DelVRFileInput(tableno)
   document.all("VRFileInput"& tableno).outerHTML = ""
    NowVRFileInputCount = NowVRFileInputCount - 1
End Sub

</script>
</body>
</html>