<%function SendMail(MailtoAddress,Subject,MailBody)
	On Error Resume Next
	SendMail=False
	Select Case MailObject 
	Case 1
		'JMail组件
		Dim JMail,contentId,sm
		MailtoAddress=split(MailtoAddress,":")
		for sm=0 to ubound(MailtoAddress)
			Set JMail = Server.CreateObject("JMail.Message")
			'response.Write JMail.version
			JMail.silent = true
			JMail.Logging = true
			JMail.Charset = "gb2312"
			JMail.Priority = 1
			
			JMail.ISOEncodeHeaders = false
			JMail.From = MailServerUserName
			JMail.FromName = WebmasterName
			
			JMail.MailServerUserName = MailServerUserName
			JMail.MailServerPassword = MailServerPassWord
			
			JMail.Subject = Subject
			JMail.HTMLBody = MailBody
			JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
			JMail.Body = "我们的邮件采用了HTML格式，但是您的邮件查看软件可能不支持!"
			JMail.AddRecipient(MailtoAddress(sm))
			SendMail=JMail.Send(MailServer)
			JMail.Close()
			Set JMail = Nothing
		next
		Exit Function
	Case 2
	'CDONTS
		MailtoAddress=split(MailtoAddress,":")
		for sm=0 to ubound(MailtoAddress)
			Set CDONTSObj = Server.CreateObject("CDONTS.NewMail")
			CDONTSObj.To = MailtoAddress(sm)
			CDONTSObj.From = MailServerUserName
			CDONTSObj.BodyFormat = 0
			CDONTSObj.MailFormat = 0
			CDONTSObj.Subject = Subject
			CDONTSObj.Body = MailBody
			SendMail=CDONTSObj.Send
			Set CDONTSObj = nothing 
		next
		Exit Function
	Case 3
	'ASPEMAIL
		MailtoAddress=split(MailtoAddress,":")
		for sm=0 to ubound(MailtoAddress)
			Set Mail=Server.CreateObject("Persits.MailSender")
			Mail.Host=MailServer
			Mail.Port=25
			Mail.username=MailServerUserName
			Mail.password=MailServerPassWord
			Mail.From=MailServerUserName
			Mail.FromName=WebmasterName
			Mail.Subject=Subject
			mail.charset="gb2312"
			Mail.IsHTML = True
			mail.body=MailBody
			Mail.AddBcc MailtoAddress(sm)
			SendMail=Mail.Send
			set Mail=nothing
		next
		Exit Function	
	Case 4
	'WebEasyMail
		MailtoAddress=split(MailtoAddress,":")
		for sm=0 to ubound(MailtoAddress)
			Set mailsend = Server.CreateObject("easymail.MailSend") 
			mailsend.CreateNew MailServerUserName,WebmasterName 'xxxxx为发送者的邮件 ' 发信人名称 
			mailsend.MailName = WebmasterName ' 邮件名称 
			mailsend.EM_To = MailtoAddress(sm) '收件人邮件地址 
			mailsend.EM_Subject = Subject '邮件主题 
			mailsend.EM_Text = MailBody '邮件内容 支持html格式 
			SendMail=mailsend.Send() 
		next
		Exit Function
	End select
End Function
%> 
