主题:  在線發mail問題,有沒有高手可以幫我解決呢

et780819

职务:普通成员
等级:1
金币:0.0
发贴:2
#12005/6/16 23:19:44
<%@LANGUAGE="VBSCRIPT" CODEPAGE="950"%>
<%session.codepage = 950%>
<!--#include file="Admin.asp"-->
<!--#include file="Conndb.asp"-->
<!-- #include file="Inc/Head.asp" -->
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="150" align="center" valign="top"> <table width="150" height="100%" border="0" cellpadding="0" cellspacing="0" class="HeaderTdStyle">
<tr>
<td align="center" valign="top"><table width="100%" height="24" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center">功能功能表</td>
</tr>
</table>
<table width="100%" height="90%" border="0" cellpadding="0" cellspacing="0" class="MenuBg">
<tr>
<td align="center" valign="top"><br> <table width="90%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="16%"><img src="../Img/Left_1.gif" width="28" height="11"></td>
<td width="84%" height="20"><font color="#FFFF00">郵件清單管理</font></td>
</tr>
</table>
<table width="90%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="34%" height="20" align="right"><img src="../Img/Left_1_1.gif" width="29" height="16"></td>
<td width="66%" valign="bottom"><a href="Maildefault.asp"><font color="#FFFF00">郵件清單設定</font></a></td>
</tr>
</table>
<table width="90%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="34%" height="20" align="right"><img src="../Img/Left_1_1.gif" width="29" height="16"></td>
<td width="66%" valign="bottom"><a href="Sendmail.asp"><font color="#FFFF00">發送郵件</font></a></td>
</tr>
</table>
<table width="90%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="34%" height="20" align="right"><img src="../Img/Left_1_1.gif" width="29" height="16"></td>
<td width="66%" valign="bottom"><a href="Viewuser.asp"><font color="#FFFF00">使用者管理</font></a></td>
</tr>
</table>
<table width="90%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="34%" height="20" align="right"><img src="../Img/Left_1_1.gif" width="29" height="16"></td>
<td width="66%" valign="bottom"><a href="Adduser.asp"><font color="#FFFF00">新增使用者</font></a></td>
</tr>
<tr>
<td height="20" align="right">&nbsp;</td>
<td valign="bottom">&nbsp;</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="862" align="center" valign="top">
    <br>
<br>
<b>發 送 郵 件</b><br>
<br>
<br>
     <%
'發送
set rs=server.createobject("adodb.recordset"
sql="select * from email "
rs.open sql,conn,1,3

'讀取預設的郵件標題及內容
set rs1=server.createobject("adodb.recordset"
sql1="select * from maildefault "
rs1.open sql1,conn,1,3

'設定發信人
frommail=request("frommail"
if frommail="" then
frommail=rs1("frommail"
end if

'設定郵件主題
mailsubject=request("mailsubject"
if mailsubject="" then
mailsubject=rs1("mailsubject"
end if

'設定郵件內容
mailbody=request("mailbody"
if mailbody="" then
mailbody=rs1("mailbody"
end if

'判斷對誰發信
tomail=request("tomail"
'寫發信資訊
response.write "發信人位址: "&frommail
response.write "<br><br><br>"
if tomail<>"" then
response.write "收信人位址:"&tomail
else
response.write "正在進行郵件群發!"
end if

if tomail<>"" then
'對於單一使用者發信
Set objCDOMail = Server.CreateObject("CDONTS.NewMail"
objCDOMail.From = frommail
objCDOMail.To = tomail
objCDOMail.Subject = mailsubject
objCDOMail.Body = mailbody
objCDOMail.Send
Set objCDOMail = Nothing
else

'對於在使用者資料庫中的全體使用者發信
for i=1 to rs.recordcount
tomail=rs("email"
Set objCDOMail = Server.CreateObject("CDONTS.NewMail"
objmail.bodypart.charset = "big5"
objCDOMail.From = frommail
objCDOMail.To = tomail
objCDOMail.Subject = mailsubject
objCDOMail.Body = mailbody
objCDOMail.Send
Set objCDOMail = Nothing
rs.movenext
next
end if
response.write "<br><br><br>"
response.write "郵件發送成功!^&^"
'response.write "<br><br><br>"
'response.write rs1("mailsubject"
%> <a href="Sendmail.asp">返回</a>
</td>
</tr>
</table>
<!-- #include file="Inc/Foot.asp" -->

都會發生錯誤代碼如下:
伺服器物件 錯誤 'ASP 0177 : 800401f3'

Server.CreateObject 失敗

/admin/sendmailto.asp, 列103

無效的類別字串



缺缺

职务:管理员
等级:8
金币:41.0
发贴:9620
#22005/6/16 23:39:55
不支持CDONTS.NewMail?