小沛 皇帝
註冊時間: 2003-04-06 文章: 504 來自: TAIWAN
|
發表於: 星期四 十一月 27, 2003 11:55 am 文章標題: 幫我一下ASP程式有關郵件的問題~! |
|
|
誰能幫我將這頁面的指令改成用Jmail元件寄送的指令
這是原始指令
<!--#include file="head.asp" -->
<%
if request("action") = "send" then
frommail = Trim(Request.Form("frommail"))
tomail = Trim(Request.Form("tomail"))
if Trim(Request.Form("mailsubject"))<>"" then
mailsubject = Trim(Request.Form("mailsubject"))
else
mailsubject = Trim(Request.Form("mailsubject1"))
end if
mailbody = Trim(Request.Form("mailbody"))
MailType = Request.Form("MailType")
if tomail<>"" then
Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
objCDOMail.From = frommail
objCDOMail.To = tomail
objCDOMail.Subject = mailsubject
if MailType = 0 then
objCDOMail.BodyFormat = 0
objCDOMail.MailFormat = 0
end if
objCDOMail.Body = mailbody
objCDOMail.Send
Set objCDOMail = Nothing
else
sql="select mail from mail"
set rs=conn.execute(sql)
Response.Write("正在郵件群發.................." )
while not rs.eof
Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
objCDOMail.From = frommail
ObjCDOMail.To = rs("mail")
objCDOMail.Subject = mailsubject
if MailType = 0 then
objCDOMail.BodyFormat = 0
objCDOMail.MailFormat = 0
end if
objCDOMail.Body = mailbody
objCDOMail.Send
RS.MoveNext
wend
set objCDOMail = Nothing
end if
Response.Write "<script>alert(""發送成功"");location.href=""main.asp"";</script>"
Response.End
end if
%>
<form name="sendmail" action="?action=send" method="post" >
<table border="0" cellspacing="1" cellpadding="4" width="80%" align="center" bgcolor="#797161">
<tr bgcolor="#ffcf00">
<td height="30" colspan="2" align="center">發 送 郵 件</td>
</tr>
<tr bgcolor="#f6f6f6">
<td height="25" width="20%" bgcolor="#f6f6f6">發信人地址:</td>
<td height="25" width="80%">
<input type="text" name="frommail" value="<%=frommail%>">
</td>
</tr>
<tr bgcolor="#f6f6f6">
<td height="25" width="20%" bgcolor="#f6f6f6">收信人地址:</td>
<td height="25" width="80%">
<input type="text" name="tomail">
<br>
<br>
(如果為空,從資料庫取地址群發!) </td>
</tr>
<tr bgcolor="#f6f6f6">
<td height="25" width="20%" bgcolor="#f6f6f6">信件標題:</td>
<td height="25" width="80%">
<input type="text" name="mailsubject" size="50">
<input type="hidden" name="mailsubject1" value="<%=mailsubject%>">
<br>
<br>
(如果為空,則顯示﹛<font color="red"><%=mailsubject%></font>﹛!) </td>
</tr>
<tr bgcolor="#f6f6f6">
<td height="25" width="20%" bgcolor="#f6f6f6">郵件類型:</td>
<td height="25" width="80%">
<input type="radio" name="MailType" value="0">HTML
<input type="radio" name="MailType" value="1" checked>TEXT
</td>
</tr>
<tr bgcolor="#f6f6f6">
<td height="25" width="20%" bgcolor="#f6f6f6">信件內容:</td>
<td height="25" width="80%">
<textarea name="mailbody" cols="50" rows="8"><%=mailbody%></textarea>
<br>
<br>
</td>
</tr>
<tr bgcolor="#f6f6f6">
<td height="10" colspan="2" align="center">
<input type="submit" name="Submit" value="發送">
<input type="reset" name="Submit" value="取消">
</td>
</tr>
</table>
</form>
<!--#include file="copy.asp" --> _________________ The house of dream
https://www.dreamhome.com.tw 夢想的家
|
|