Nyhedsbrevsscript skriver catastrophic error.
Hey - håber der er nogle eksperten som kan løse denne her:error´8000ffff´
catastrophic failure
admin/send2.asp,line 44
Min kode ser sådan ud:
<!--#include file="dsn.asp"-->
<% Session.LCID = 1030
nyhedIDlist = Request.Form("nyhed")
if nyhedIDlist <> "" then
'Hendt de valgt nyheder ud:
Set NyhedRs = Conn.Execute("Select ID, Dato, Overskrift, Nyhed From Nyheder WHERE ID IN (" & nyhedIDlist & ") Order By Dato Desc")
While Not NyhedRs.EOF
Body = Body & vbCrlf & vbCrlf & "<font face=""verdana"" size=""4"">" & NyhedRs("Overskrift") & "</font>" & "<br></td></tr><tr><td height=""1"" bgcolor=""#CCCCCC""></td></tr><tr><td>" & vbCrlf & "<font face=""verdana"" size=""1"">(" & NyhedRs("Dato") & ")</font>" & "<br><font face=""verdana"" size=""2"">" & vbCrlf & Replace(left(NyhedRs("Nyhed"),300), vbCrLf, "<br>") & vbCrlf & "...<br><a face=""verdana"" href=""http://www.xxx.dk/nyheder.asp?ID=" & NyhedRs("ID") & """> læs mere ››</a></font><br><br>"
NyhedRs.MoveNext
Wend
End If
Tekst = Replace(Request.Form("Body"), vbCrLf, "<br>")
Server.ScriptTimeout = 10000000
Set RS = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT Email FROM List"
RS.open SQL, conn
counter = 0
Do While Not RS.eof
counter = counter + 1
dtmTid = Now()
dtmPause = DateAdd("s",3,dtmTid)
If counter = 10 Then
Do While dtmPause > dtmTid
dtmTid = Now()
Loop
counter = 0
End If
Set mailObj = Server.CreateObject("SMTPsvg.Mailer")
mailObj.ContentType = "text/html"
mailObj.FromName = "xxx.dk"
mailObj.FromAddress= "robot@xxx.dk"
mailObj.RemoteHost = "mail6.wannafind.dk"
mailObj.Subject = "ugentlig e-mail"
mailObj.BodyText = " <html>" & vbCrLf _
& " <head>" & vbCrLf _
& " <title>ugentlig e-mail</title>" & vbCrLf _
& " <meta http-equiv=Content-Type content=""text/html; charset=iso-8859-1"">" & vbCrLf _
& " </head>" & vbCrLf _
& " <body bgcolor=""#FFFFFF"" text=""#000000"" leftmargin=""0"" topmargin=""0"">" & vbCrLf _
& " <TABLE WIDTH=""550"" BORDER=""0"" CELLPADDING=""0"" align=""center"" CELLSPACING=""0"" bgcolor=""#FFFFFF"">" & vbCrLf _
& " <tr><td height=""1"" bgcolor=""#CCCCCC""></td></tr>" & vbCrLf _
& " </tr><tr><td><font face=""verdana"" size=""2"">" & Tekst & "</font></td></tr>" & vbCrLf _
& " <tr><td height=""1"" bgcolor=""#CCCCCC""></td></tr>" & vbCrLf _
& " <tr><td><br><font face=""verdana"" size=""2"">" & Body & "</font>" & vbCrLf _
& " </td></tr>" & vbCrLf _
& " <tr><td height=""1"" bgcolor=""#CCCCCC""></td></tr>" & vbCrLf _
& " <tr><td>" & vbCrLf _
& " </td></tr>" & vbCrLf _
& " <tr><td height=""1"" bgcolor=""#CCCCCC""></td></tr>" & vbCrLf _
& " </table>" & vbCrLf _
& " </body>" & vbCrLf _
& " </html>" & vbCrLf
mailObj.AddRecipient RS("Email"),RS("Email")
mailObj.SendMail
RS.movenext
Loop
%>
Linje 44 er:
mailObj.BodyText = "<html>" & vbCrLf _
Og det er jo bare starten på nyhedsbrevet. Så jeg fatter ikke en dej af hva der sker. Som i kan se ud fra scriptet har jeg sat den til at vente 3 sekunder hved hver 10. udsandte mail...
Hvad er der galt med mit script?
Mvh
/Jens