'****************************************************
' Function name: SendMail
' function: Send mail with JMail component
' parameter: serveraddress----server address
' AddRecipient----address of the addressee.
' Subject----Theme
' Body----Letter Content
' Sender----Sender Address
'****************************************************
function SendMail (mailserveraddress,addrecipient,subject,body,sender,mailfrom)
On Error Resume Next
Dim JMail
Set jmail=server.createobject ("Jmail.smtpmail")
If Err Then
Sendmail= "<br><li> not installed JMail components </li>"
Err.Clear
Exit function
End If
Jmail.logging=true
jmail.charset= "gb2312"
Jmail.contenttype = "Text/html"
Jmail.serveraddress=mailserveraddress
Jmail.addrecipient=addrecipient
Jmail.subject=subject
Jmail.body=mailbody
Jmail.sender=sender
Jmail.from = Mailfrom
Jmail.priority=1
Jmail.execute
Set jmail=nothing
If Err Then
Sendmail=err.description
Err.Clear
Else
Sendmail= "OK"
End If
End Function