<%
'******************************
'函數:SendMail(MailtoAddress,MailtoName,Subject,MailBody,FromName,MailFrom,Priority)
'參數:MailtoAddress,接收郵件地址;MailtoName,接收者姓名;ubject,主題;ailBody,郵件內容;FomName,主送姓名;ailFrom,主送郵件地址;riority,郵件等級
'作者:阿裡西西
'日期:2007/7/13
'描述:JMAIL通用發送函數
'示例:<%=SendMail(MailtoAddress,MailtoName,Subject,MailBody,FromName,MailFrom,Priority)%>
'******************************
function SendMail(MailtoAddress,MailtoName,Subject,MailBody,FromName,MailFrom,Priority)
on error resume next
Dim JMail
Set JMail=Server.CreateObject("JMail.Message")
if err then
SendMail= "<br><li>沒有安裝JMail組件</li>"
err.clear
exit function
end if
JMail.Charset="gb2312"
JMail.silent=true
JMail.ContentType = "text/html"
JMail.MailServerUserName = MailServerUserName
JMail.MailServerPassWord = MailServerPassword
JMail.MailDomain = MailDomain
JMail.AddRecipient MailtoAddress,MailtoName
JMail.Subject=Subject
JMail.HMTLBody=MailBody
JMail.Body=MailBody
JMail.FromName=FromName
JMail.From = MailFrom
JMail.Priority=Priority
JMail.Send(MailServer)
SendMail =JMail.ErrorMessage
JMail.Close
Set JMail=nothing
end function%>