注册jmail.dll 方法,jmail.dll在pb中的应用收发邮件
-
jan 08
注册jmail.dll 方法,jmail.dll在pb中的应用收发邮件
2013-1-8 10:19发表 && 分类:电脑软件 &&浏览:302&&网际社区&技术问答&电脑百科&博客收录 评论 &&|&& -
1、注册jmail.dll 方法:在运行中输入: regsvr32 路径\jmail.dll
2、示例代码:
oleobject jmail
jmail = create oleobject
jmail.connecttonewobject("jmail.message")
jmail.charset = ls_charset //中文用 “gb2312”
jmail.isoencodeheaders = true
jmail.silent = true
jmail.logging = true
jmail.from = ls_user //发件人邮箱
jmail.fromname = ls_mail_fr //发件人
jmail.subject = ls_subject //邮件主题
jmail.mailserverusername = ls_user //发件邮箱登录账户
jmail.mailserverpassword = ls_pwd //发件邮箱用户密码
jmail.priority = 3 //优先级
jmail.addrecipient(ls_mail_to) //收件人邮箱
jmail.body =ls_text + "~r~n" //邮件内容
if jmail.send(ls_host) then //ls_host为发件邮箱服务器
messagebox('info',"发送成功!")
else
messagebox('info',"发送失败!")
end if
jmail.close()
destroy jmail