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
评论
评论 (0)