Jmail发信的实例,模块化随时调用
时间:2009-06-23 16:40:48
作者:互联网
一个用jmail发信的过程,及使用方法.
发信时,直接调用这个过程就行了。
<%
dim str,HtmlBody
HtmlBody=
"I Love 2Yup!
"
str=JmailSend(
"hello",
"ILoveYou",
true,HtmlBody,
"yo***[email protected]",
yo***[email protected]">yo***[email protected],
"hello","sm***sina.com.cn","hello","Password")
if str="Y" then
response.write("发送成功")
else
response.write("发送失败!请重试!")
end if
function JmailSend(Subject,Body,isHtml,HtmlBody,MailTo,From,FromName,Smtp,Username,Password)
dim JmailMsg
set JmailMsg=server.createobject("jm***.message")
Jm***Msg.mailserverusername=Username
Jm***Msg.mailserverpassword=Password
Jm***Msg.addrecipient MailTo
Jm***Msg.from=From
Jm***Msg.fromname=FromName
JmailMsg.charset="gb2312"
Jm***Msg.logging=true
Jm***Msg.silent=true
Jm***Msg.subject=Subject
Jm***Msg.body=Body
if isHtml=true then Jm***Msg.htmlbody=HtmlBody
if not Jm***Msg.send(Smtp) then
JmailSend="N"
else
JmailSend="Y"
end if
JmailMsg.close
set JmailMsg=nothing
end function
%>