PC6下载站

分类分类

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

关注+2004-11-07作者:蓝点

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



<%@ Language=VBScript %>

<%

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



'这个文件用来发送邮件

'作者:awayeah

'邮箱:awayeah@163.net



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



if session("straccount")="" or session("strpassword")="" then

Response.End

end if

%>













<%   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 ("



")

'     Response.Write ("

邮件已成功发出!"

'      session("sended")="Y"

   Else

  if x=7 or x=5 then

      Response.Write "

发邮件发生错误(" + cstr(x)+ ").发件人地址错误"%>

       



      <%Response.End

  else

      Response.Write "

发邮件发生错误: "   + cstr(x)+ ""%>

       



      <%Response.End

  end if

  End If





   Set SMTP = Nothing

   

%>





返回












展开全部

相关文章

更多+相同厂商

热门推荐

  • 最新排行
  • 最热排行
  • 评分最高
排行榜

    点击查看更多

      点击查看更多

        点击查看更多

        说两句网友评论

          我要评论...
          取消