Jmail發信的案例,模塊化隨時調用
發表時間:2023-08-16 來源:明輝站整理相關軟件相關文章人氣:
[摘要]一個用jmail發信的過程,及使用方法.發信時,直接調用這個過程就行了。"hello","smtp.sina.com.cn","hello"...
一個用jmail發信的過程,及使用方法.
發信時,直接調用這個過程就行了。
"hello","smtp.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("jmail.message")
JmailMsg.mailserverusername=Username
JmailMsg.mailserverpassword=Password
JmailMsg.addrecipient MailTo
JmailMsg.from=From
JmailMsg.fromname=FromName
JmailMsg.charset="gb2312"
JmailMsg.logging=true
JmailMsg.silent=true
JmailMsg.subject=Subject
JmailMsg.body=Body
if isHtml=true then JmailMsg.htmlbody=HtmlBody
if not JmailMsg.send(Smtp) then
JmailSend="N"
else
JmailSend="Y"
end if
JmailMsg.close
set JmailMsg=nothing
end function
%>