精华区 [关闭][返回]

当前位置:月光软件>>讨论区精华>>〖软件开发〗>>● ASP>>★ASP的技巧★>>组件开发及应用>>在ASP中用EasyMailObject组件处理Exchange邮件源代码---发送邮件(p

主题:在ASP中用EasyMailObject组件处理Exchange邮件源代码---发送邮件(p
发信人: zzdevilfish(章鱼.Net)
整理人: dongbao(2002-04-23 17:25:52), 站内信件
<%@ Language=VBScript %>
<%
'*************************************

'这个文件用来发送邮件
'作者:awayeah
'邮箱:[email protected]

'*************************************

if session("straccount")="" or session("strpassword")="" then
Response.End
end if
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<STYLE>
<!--
A{text-decoration:none}
-->
</STYLE>
<BODY>
<% Set SMTP = CreateObject("EasyMail.SMTP.5")
SMTP.LicenseKey = "awa/S19I500R1AX30C0R3100"
SMTP.MailServer = "192.9.200.89"
SMTP.Subject = Request.Form("subject")
SMTP.BodyText = Request.Form("bodytext")
SMTP.From = Request.Form("from")
SMTP.FromAddr = Request.Form("fromaddr")
SMTP.AddRecipient Request.Form("from"), Request.Form("receive1") , 1

'添加附件
if Request.Form("att")="" then
Response.Write ""
else
x = SMTP.AddAttachment(Request.Form("att"), 0)
If Not x = 0 Then
Response.Write "插入附件错误: " + cstr(x) + "请与管理员联系。"
End If
end if
x = SMTP.Send

If x = 0 Then
' Response.Write ("<P align=center><br><br>")
'     Response.Write ("<font size=")
Response.Write "<p align='center'><br><br><span style='background-color: #000080'>邮件已成功发出!</span>"
'      session("sended")="Y"
   Else
  if x=7 or x=5 then
      Response.Write "<br><br><p align='center'><span style='background-color: #000080'>发邮件发生错误(" + cstr(x)+ ").发件人地址错误</span>"%>
       <br><br><input type="button" onclick="history.go(-1)" value="返回">
      <%Response.End
else
Response.Write "<br><br><p align='center'><span style='background-color: #000080'>发邮件发生错误: "   + cstr(x)+ "</span>"%>
       <br><br><input type="button" onclick="history.go(-1)" value="返回" id=button1 name=button1>
      <%Response.End
end if
End If


Set SMTP = Nothing

%> 

<P align="center"> <a href="javascript:window.close();">
<font face="宋体" size="5"><span style="background-color: #FFFF00">返回</span></P>

</BODY>
</HTML>




----
---------------------------------------
本人的[个人版]程序员之路已经开版
太阳品网祝您身体健康,天天有份好心情!
太阳esun评测中心欢迎您!!!
http://www.esun.cc
本人OICQ:264027 E-MAIL:[email protected]   

[关闭][返回]






转载请注明:转载自 月光程序代码网 [ http://www.moon-soft.com ]