gigigo Groupie
加入: 2004/5月/31
Online Status: Offline 回復: 42
|
Posted: 2004/5月/31 10:30上午 | IP記錄
|
|
|
發信時,直接調用這個過程就行了。 <% dim str,HtmlBody HtmlBody="<html><body bgcolor='red' topmargin='40'><p align='center'>I Love 2Yup!</p></html>" str=JmailSend( "2yup","ILoveYou",true,HtmlBody,"2yup@2yup.com","suercool@si na.com","suercool","smtp.sina.com.cn","suercool","Password")
if str="Y" then response.write("發送成功") else response.write("發送失敗!請重試!") end if '================================================= '函數名:JmailSend '作 用:用Jmail發送郵件 '參 數:Subject 郵件標題 ' Body 郵件內容 ' Body 郵件內容 ' isHtml 是否發送Html格式郵件 (true 是) ' HtmlBody Html格式郵件內容 ' MailTo 收件人Email ' From 發件人Email ' FromName 發件人姓名 ' Smtp smtp服務器 ' Username 郵箱使用者名 ' Password 郵箱密碼 '返回值:JmailSend="N" 發送失敗 JmailSend="Y" 發送成功 '~~~~~~~~~~suercool~~~~~
'=================================================
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="big5" 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 %>
Edited by admin 在 2004/6月/02 3:26下午
|