Chinaunix首页 | 论坛 | 博客
  • 博客访问: 399651
  • 博文数量: 148
  • 博客积分: 3191
  • 博客等级: 中校
  • 技术积分: 1232
  • 用 户 组: 普通用户
  • 注册时间: 2011-08-11 15:25
文章分类

全部博文(148)

文章存档

2011年(148)

我的朋友

分类: WINDOWS

2011-08-12 10:53:53

 将以下内容用.vbs保存
 
 
 
 
'//Jmail组件使用示例
 '//作者:lison
 '//日期:2007-5-22
 '//创建jmail发信组件
 Set JMail = CreateObject("JMail.Message")
 
  '//邮件的头设置
 JMail.ContentType = "text/plain" '//文本格式邮件
 'JMail.ContentType = "text/html" '//网页格式邮件
 
 '//邮件发送者
 JMail.From = ""
 '//显示名
 JMail.FromName = "avinliuxx"
 
 '//设置能/不能登陆用JMAIL
 JMail.Logging = True
 
 '//设置成TRUE后JMAIL将检查所有的邮件在 JMail.execute() 执行后返回真或假,根据信件发送的成功与否
 JMail.silent = False '//设置成true,会反馈发送结果,速度会比较慢,不建议设置成true
 
 '//设定邮件的字符集
 JMail.Charset = "gb2312"
 
 '//设置主题
 JMail.Subject = "测试邮件" & Now()
 
 '//设置邮件内容,根据ContentType设置为选择
 JMail.Body = "test" '//ContentType设置为text/plain
 'JMail.HTMLBody = "test" '//ContentType设置为text/html
 
 '//设置邮件服务器验证者,必需在邮件服务器上存在相应账号
 JMail.MailServerUserName = ""
 JMail.MailServerPassword = "avinpassword"
 
 JMail.ClearRecipients()
 '//设置接受者1
 receiver = ""
 JMail.AddRecipient receiver,receiver
 
 '//设置接受者2
 receiver = ""
 JMail.AddRecipient receiver,receiver
 
 '//抄写一份给另一接受者
 JMail.AddRecipientCC( "" )
 
 '//发送到邮件服务器,服务器ip10.32.3.205
 If JMail.Send("10.32.3.205",false) Then
  MsgBox("成功发送")
 Else
  MsgBox("发送失败,请检查邮件地址是否有效")
 End If
 '//注销组件
 Set Jmail = Nothing
 
阅读(1080) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~