A process of sending letters using jmail and how to use it.
When sending a letter, just call this process directly.
<%
dim str,HtmlBody
HtmlBody=
"<html><body bgcolor='red' topmargin='40'><p align='center'>I Love 2Yup!</p></html>"
str=JmailSend(
"hello" ,
"ILoveYou" ,
true ,HtmlBody,
"[email protected]" ,
[email protected] ,
"hello" , "smtp.sina.com.cn" , "hello" , "Password " )
if str= "Y" then
response.write (" sent successfully" )
else
response . write ( "Sending failed! Please try again!" )
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
%>