前几天下载了个WEB进销存,想让他出库后自动发送邮件的代码,直接将打印单内容发送到指定邮箱
这是打印单的图片 打印单的代码是<%
if request.Cookies("shiwei_username")="" then
%>
<script language="javascript">
top.location.href="../index.asp"
</script>
<%
response.end
end if
%>
<!-- #include file="../conn2.asp" -->
<!-- #include file="../const.asp" -->
<html>
<head>
<title><%=dianming%> - 打印</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../style2.css" rel="stylesheet" type="text/css">
<script language=javascript>
function preview() {
bdhtml=window.document.body.innerHTML;
sprnstr="<!--startprint-->";
eprnstr="<!--endprint-->";
prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17);
prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));
window.document.body.innerHTML=prnhtml;
window.print();
window.document.body.innerHTML=bdhtml;
}
</script>
<style media=print>
.Noprint{display:none;}
</style>
</HEAD>
<BODY>
<%
set rs_buy=conn.execute("select * from sell where zu=false and bianhao='"&request("bianhao")&"'")
nowid_login=rs_buy("id_login")
nowddno=rs_buy("ddan")
if nowddno<>"" then
bianhao=nowddno
else
bianhao=request("bianhao")
end if
set rs_login=conn.execute("select * from login where id="&rs_buy("id_login"))
if rs_login.eof then
nowlogin=rs_buy("login")
else
nowlogin=rs_login("username")&" ("&rs_login("bianhao")&")"
end if
set rs_huiyuan=conn.execute("select * from huiyuan where id="&rs_buy("id_huiyuan"))
%>
<!--startprint-->
<table width="98%" border="0" cellpadding="0" cellspacing="2" align="center">
<tr>
<td height="21" align="center"><h1 style="font-size:<%=hang_b%>"><%=biao_t%></h1></td>
</tr>
<tr>
<td height="21" align="center"><h1 style="font-size:<%=hang_b2%>"><%=biao_t2%></h1></td>
</tr>
<tr>
<td height="21" align="left">
客户名称:<input type="text" value="<%if rs_huiyuan.eof=false then%><%=rs_huiyuan("username")%><%end if%>" size="30" style="border-bottom:solid 1 #000000;border-top:solid 0 #000000;border-left:solid 0 #000000;border-right:solid 0 #000000; text-align:left;">
出库日期:<input type="text" value="<%=rs_buy("selldate")%>" size="12" style="border-bottom:solid 1 #000000;border-top:solid 0 #000000;border-left:solid 0 #000000;border-right:solid 0 #000000;">
订单号码:<input type="text" value="<%=bianhao%>" size="12" style="border-bottom:solid 1 #000000;border-top:solid 0 #000000;border-left:solid 0 #000000;border-right:solid 0 #000000;">
</td>
</tr>
</table>
<table width="<%if biao_k >100 then%><%=biao_k%>px<%else%><%=biao_k%>%<%end if%>" border="1" cellspacing="0" cellpadding="2" align="center" bordercolor="#000000">
<tr>
<%if showpic="yes" then%>
<th width="70">图片</th>
<%end if%>
<th height="30">产品名称</th>
<th>规格型号</th>
<th>数量</th>
<th>单位</th>
</tr>
<%
totalprice=0
i=0
do while rs_buy.eof=false
set rs_produit=conn.execute("select * from produit where huohao='"&rs_buy("huohao")&"'")
%>
<tr>
<%if showpic="yes" then%><td align="center"><%if rs_produit.eof then%><%if rs_buy("photo")<>"" then%><a href="../upload/<%=rs_buy("photo")%>" target="_blank"><img src="../upload/<%=rs_buy("photo")%>" border="0" width="60"></a><%else%>无图<%end if%><%else%><%if rs_produit("photo")<>"" then%><a href="../upload/<%=rs_produit("photo")%>" target="_blank"><img src="../upload/<%=rs_produit("photo")%>" border="0" width="60"></a><%else%>无图<%end if%><%end if%></td><%end if%>
<td align="center" height="<%=hang_g%>"><%if rs_produit.eof then%><%=rs_buy("huohao")%><%else%><%=rs_produit("huohao")%><%end if%></td>
<td align="center"><%if rs_produit.eof then%><%=rs_buy("title")%><%else%><%=rs_produit("title")%><%end if%></td>
<td align="center"><%=formatnumber(rs_buy("shulian"),2)%></td>
<td align="center"><%if rs_produit.eof=false then%><%=rs_produit("danwei")%><%end if%></td>
</tr>
<%
totalprice=totalprice+rs_buy("price")*rs_buy("shulian")
rs_buy.movenext
i=i+1
loop
%>
<%
if i < hang then
ii=hang-i
y=1
do while y<=ii %>
<tr>
<%if showpic="yes" then%><td align="center"> </td><%end if%>
<td align="center" height="<%=hang_g%>"> </td>
<td align="center"> </td>
<td align="center"> </td>
<td align="center"> </td>
</tr>
<%
y=y+1
loop
end if
%>
<tr></tr>
</table>
<table width="98%" border="0" cellpadding="0" cellspacing="2" align="center">
<tr>
<td height="21" width="39%">
送货地址:<input type="text" value="<%=rs_huiyuan("address")%>" size="30" style="border-bottom:solid 1 #000000;border-top:solid 0 #000000;border-left:solid 0 #000000;border-right:solid 0 #000000;">
</td>
<td height="21" width="22%">
客户电话:
<input type="text" value="<%=rs_huiyuan("tel")%>" size="11" style="border-bottom:solid 1 #000000;border-top:solid 0 #000000;border-left:solid 0 #000000;border-right:solid 0 #000000;">
</td>
<td align="right" width="20%">
操作员:
<input type="text" value="<%=nowlogin%>" size="12" style="border-bottom:solid 1 #000000;border-top:solid 0 #000000;border-left:solid 0 #000000;border-right:solid 0 #000000;">
</td>
<td align="right" width="19%">
客户签收:
<input type="text" value="" size="10" style="border-bottom:solid 1 #000000;border-top:solid 0 #000000;border-left:solid 0 #000000;border-right:solid 0 #000000;">
</td>
</tr>
</table>
<table width="98%" border="0" cellpadding="0" cellspacing="2" align="center">
<tr>
<td height="21" align="center"><span class="noprint"><img src="../images/print.jpg" align="absmiddle" style="cursor:hand;" onClick="preview();window.close()" alt="点击开始打印,此图像不会被打印出来"></span></td>
</tr>
</table>
<!--endprint-->
</body>
</html>
请问该如何添加自动发送到邮件呢 |