将以下内容用.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
阅读(1125) | 评论(0) | 转发(0) |