Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6513657
  • 博文数量: 915
  • 博客积分: 17977
  • 博客等级: 上将
  • 技术积分: 8846
  • 用 户 组: 普通用户
  • 注册时间: 2005-08-26 09:59
个人简介

一个好老好老的老程序员了。

文章分类

全部博文(915)

文章存档

2022年(9)

2021年(13)

2020年(10)

2019年(40)

2018年(88)

2017年(130)

2015年(5)

2014年(12)

2013年(41)

2012年(36)

2011年(272)

2010年(1)

2009年(53)

2008年(65)

2007年(47)

2006年(81)

2005年(12)

分类: 系统运维

2011-06-02 08:48:22

  1. <%
  2. response.write("
    "
    )
  3. Set bobj = Server.CreateObject("basp21") ' ASP
  4. response.write(bobj.Version())
  5. response.write("
    ")
  6. logname="C:\maillog.txt" ' Name full path of log file
  7. svname="smtp.126.com" ' Name of SMTP Server SMTP邮件服务器
  8. mailto="ddddxx2 " ' Reciever's mail address 接收邮件地址
  9. mailfrom="xxzz     user:pass" ' Sender's mail address 发送邮件地址,需要验证时用户名密码和Email之间用Tab键分隔,而basp21pro使用的是,分隔
  10. subj="Hello w/attached file" ' Mail Subject
  11. body="Hey, what's up ?" ' Mail Body
  12. files="x:\xxx.log" ' Attached Files 附加文件,没有附件时怎么写还没有确认
  13. rc=bobj.SendMail(svname,mailto,mailfrom,subj,body,files)
  14. if rc = "" then
  15.     response.write("send mail success")
  16. else
  17.     response.write(rc)
  18. end if
  19. response.write("
    "
    )
  20. %>

在需要SMTP验证时,basp21pro是用逗号(,)分隔邮件地址和用户名密码的,而basp21是使用Tab键分隔的。

而且mailto和mailfrom不能直接写邮件地址,而需要采用“xx <>”这样的格式。

阅读(2673) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~