用EasyMailObject组件处理Exchange邮件源代码(5)

2016-01-29 17:41 1 1 收藏

用EasyMailObject组件处理Exchange邮件源代码(5),用EasyMailObject组件处理Exchange邮件源代码(5)

【 tulaoshi.com - ASP 】

  在ASP中用EasyMailObject组件处理Exchange邮件源代码---发送邮件(p_sendmail.asp)

<%@ Language=VBScript %
<%
'*************************************

'这个文件用来发送邮件
'作者:awayeah
'邮箱:awayeah@163.net

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

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<b<font face='宋体' size='5' color='#00FFFF'<span style='background-color: #000080'邮件已成功发出!</font</span</b"
'      session("sended")="Y"
   Else
  if x=7 or x=5 then
      Response.Write "<br<br<p align='center'<b<font face='宋体' size='5' color='#00FFFF'<span style='background-color: #000080'发邮件发生错误(" + cstr(x)+ ").发件人地址错误</span</font</b"%
       <br<br<input type="button" onclick="history.go(-1)"  value="返回"
      <%Response.End
  else
      Response.Write "<br<br<p align='center'<b<font face='宋体' size='5' color='#00FFFF'<span style='background-color: #000080'发邮件发生错误: "   + cstr(x)+ "</span</font</b"%
       <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"<b<span style="background-color: #FFFF00"返回</span</b</font</a</P

</BODY
</HTML

 

来源:https://www.tulaoshi.com/n/20160129/1502514.html

延伸阅读
标签: ASP
读取邮件内容和附件(showbody1.asp) <%@ LANGUAGE="VBSCRIPT" % <% '************************************************ '这个文件显示邮件的内容和附件 '作者:awayeah '邮箱:awayeah@163.net '************************************************ % <html <head <title读邮件</title </head <body <% SET PO...
标签: ASP
保存附件(saveatt.asp) <%@ Language=VBScript % <% '************************************* '这个文件用来下载附件 '作者:awayeah '邮箱:awayeah@163.net '************************************* Dim fso, tempfile Set fso = CreateObject("Scripting.FileSystemObject") Dim tfolder, tname, tfile ' Const TemporaryFolder ...
标签: ASP
发送邮件的界面(sendmail1.asp) <%@ LANGUAGE="VBSCRIPT" % <% '************************************* '这个文件是发送邮件或回复邮件的界面 '作者:awayeah '邮箱:awayeah@163.net '************************************* '取得回信地址 replyaddr=Request.QueryString("addr") '取得要回邮件的主题 replysubj=replace(Request...
标签: ASP
删除邮件时调用的文件(mail_prc.asp) <%@ Language=VBScript % <% '************************************* '这个文件是删除邮件时调用的 '作者:awayeah '邮箱:awayeah@163.net '************************************* dim cc,cc1,sep,dd '取得邮件总数 msgcount = session("msgcount") sep="," for i=1 to msgcount dd="c"+cstr...
前言 Jive是一个开放的Java源代码项目。其目标是建设一个开放结构的,强壮的,易于扩展的基于jsp的论坛。在其设计目标的指导下,其结构设计得非常得好,融合了很多新的观念,比如Design Pattern,可更换的SKIN,可插入Plug等等。 !-- frame contents --!-- /frame contents -- 具体解读其源代码对于理解这些新的设计上的...

经验教程

41

收藏

21
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部