leatherlips Senior Member
USA 1838 Posts
Syntax error /forum/testnewsletter.asp, line 90 if Err.Number = then
Carefree Advanced Member
Philippines 4222 Posts
<% '############################################################################### '## '## Snitz Forums 2000 v3.4.07 '## '############################################################################### '## '## Copyright © 2000-06 Michael Anderson, Pierre Gorissen, '## Huw Reddick and Richard Kinser '## '## This program is free. You can redistribute and/or modify it under the '## terms of the GNU General Public License as published by the Free Software '## Foundation; either version 2 or (at your option) any later version. '## '## All copyright notices regarding Snitz Forums 2000 must remain intact in '## the scripts and in the HTML output. The "powered by" text/logo with a '## link back to http://forum.snitz.com in the footer of the pages MUST '## remain visible when the pages are viewed on the internet or intranet. '## '## This program is distributed in the hope that it will be useful but '## WITHOUT ANY WARRANTY; without even an implied warranty of MERCHANTABILITY '## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License '## for more details. '## '## You should have received a copy of the GNU General Public License along '## with this program; if not, write to: '## '## Free Software Foundation, Inc. '## 59 Temple Place, Suite 330 '## Boston, MA 02111-1307 '## '## Support can be obtained from our support forums at: '## '## http://forum.snitz.com '## '## Correspondence and marketing questions can be sent to: '## '## manderson@snitz.com '## '############################################################################### %> <!--#INCLUDE FILE="config.asp" --> <% If Session(strCookieURL & "Approval") = "15916941253" Then %> <!--#include file="inc_func_common.asp"--> <!--#INCLUDE file="inc_header.asp" --> <% Response.Write "<center>" & vbNewLine & _ "<table border=""0"" width=""100%"" align=""center"">" & vbNewLine & _ " <tr>" & vbNewLine & _ " <td width=""33%"" align=""left"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _ " "&getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""")&" <a href=""default.asp"">All Forums</a><br>" & vbNewLine & _ " "&getCurrentIcon(strIconBar,"","align=""absmiddle""")&getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""")&" <a href=""admin_home.asp"">Admin Section</a><br>" & vbNewLine & _ " "&getCurrentIcon(strIconBlank,"","align=""absmiddle""")&getCurrentIcon(strIconBar,"","align=""absmiddle""")&getCurrentIcon(strIconFolderOpenTopic,"","align=""absmiddle""")&" <a href=""nladmin.asp"">NewsLetter Administration</a><br><br></font>" & vbNewLine & _ " </td>" & vbNewLine & _ " </tr>" & vbNewLine & _ "</table><br>" & vbNewLine %> <SCRIPT LANGUAGE=javascript> <!-- function confirmAction() { return confirm("THIS ACTION WILL SEND YOUR MESSAGE TO\nALL SUBSCRIBERS IN THE LIST!\n\nClick OK to Send!\nClick Cancel to Abort!") } function OpenPreview() { var curCookie = "strMessagePreview=" + escape(document.PostTopic.Message.value); document.cookie = curCookie; popupWin = window.open('pop_preview_html.asp', 'preview_page', 'scrollbars=yes,width=750,height=450') } //--> </script> <% strEmailFrom = "forum@mangionemagic.com" strTo = "All Users In Mailing List" strHead = "Mangione Magic NewsLetter" strCell = "This is not SPAM, you requested to join the Newsletter list" strDate = "Mangione Magic Newsletter - " & Date() strBody1 = "Copy And Paste The Newsletter Here. Leave the two breaks in. ---> <br><br>" strBody2 = "<b>Your Suggestions</b><br><br>Do you have a suggestion or idea for the Mangione Magic Newsletter? If so, you can send an email to <a href='mailto:newsletter@mangionemagic.com?subject=Mangione Magic Newsletter'>newsletter@mangionemagic.com</a>." strBody3 = "Do you have a friend who may be interested in reading this newsletter? If so, you can <a href='http://www.mangionemagic.com/newsletterarchives/ADD DATE HERE.htm'>click here</a> to send them a web version of the newsletter where they will also have a chance to subscribe.<br><br>Don't forget to visit the official <a href=http://www.chuckmangione.com>Chuck Mangione website</a>.<br><br><br><br><center>" & strCopyright & "<br><a href=http://www.mangionemagic.com>www.mangionemagic.com</a><br><br><a href=http://www.mangionemagic.com><img border=0 src=http://www.mangionemagic.com/images/footerlogo.gif width=100 height=100 alt=MangioneMagic.com></a></center>" if (Request.Form("NLTopic")="Complete") and (Request.Form("Submit") = "Test Newsletter!") then strSubject = Request.Form("txtSubject") strHead = Request.Form("txtHead") strCell = Request.Form("txtCell") strDate = Request.Form("txtDate") strBody = Request.Form("Message") strBody2 = Request.Form("txtBody2") strBody3 = Request.Form("txtBody3") strFromName = strForumTitle strRecipientsName = MemberName strRecipients = strEmailFrom strUserID = MemberID strSender = strEmailFrom strMessage = "<table border=0 align=center width=760px cellspacing=0 cellpadding=0 bgcolor=#9999FF><tr><td><img border=0 src=http://mangionemagic.com/images/nlbanner.gif width=760 height=101><table border=0 width=100% cellspacing=1 cellpadding=4><TR><TD></td></tr><tr><td background=http://mangionemagic.com/forum/images/gradient.gif align=center>" & vbNewline & vbNewline strMessage = strMessage & "<font face=" & strDefaultFontFace & " size=" & strDefaultFontSize & " color=" & strHeadFontColor & "><b>" & strDate & "</b></font></td></tr>" & vbNewline & vbNewline strMessage = strMessage & "<tr><td bgcolor=#FFFFFF><font face=" & strDefaultFontFace & " size=" & strDefaultFontSize & " color=" & strDefaultFontColor & ">" & strBody1 & "" & vbNewline & vbNewline strMessage = strMessage & "<font face=" & strDefaultFontFace & " size=" & strDefaultFontSize & " color=" & strDefaultFontColor & ">" & strBody2 & "</font><br><br>" & vbNewline & vbNewline strMessage = strMessage & "<font face=" & strDefaultFontFace & " size=" & strFooterFontSize & " color=" & strDefaultFontColor & "><hr width=70% color=#6666CC><ul><li>Your email address " & strRecipients & " is subscribed to the Mangione Magic Newsletter.</li><li>If you wish to unsubscribe from this newsletter you may <a href=" & strForumURL & "nldeactivate.asp?email=" & strRecipients & "&userid=" & strUserID & ">click here</a>.</li><li>By clicking on the above link you will automatically be removed from the Mangione Magic Newsletter.</li></ul>" & strBody3 & "" & vbCrLf & vbCrLf & "</font></font></td></tr></table></td></tr></table>" & vbNewline & vbNewline %> <!--#INCLUDE FILE="inc_mail_html.asp" --> <% Elseif (Request.Form("NLTopic")="Complete") and (Request.Form("Submit") = "Send Newsletter!") then strSubject = Request.Form("txtSubject") strHead = Request.Form("txtHead") strCell = Request.Form("txtCell") strDate = Request.Form("txtDate") strBody1 = Request.Form("Message") strBody2 = Request.Form("txtBody2") strBody3 = Request.Form("txtBody3") 'Select Records strSQL_SelectEmail = "SELECT ID, Email FROM " & strTablePrefix & "MailList WHERE Active=1" Set rsMail = my_Conn.Execute(strSQL_SelectEmail) if rsMail.BOF and rsMail.EOF then Response.Write "<br>The Database is Empty.<br>" else rsMail.MoveFirst Do While Not rsMail.EOF strFromName = strForumTitle strRecipientsName = rsMail.Fields("Email").Value strRecipients = rsMail.Fields("Email").Value strUserID = rsMail.Fields("ID").Value strSender = strEmailFrom strSubject = strSubject strMessage = "<table border=0 align=center width=760px cellspacing=0 cellpadding=0 bgcolor=#9999FF><tr><td><img border=0 src=http://mangionemagic.com/images/nlbanner.gif width=760 height=101><table border=0 width=100% cellspacing=1 cellpadding=4><TR><TD></td></tr><tr><td background=http://mangionemagic.com/forum/images/gradient.gif align=center>" & vbNewline & vbNewline strMessage = strMessage & "<font face=" & strDefaultFontFace & " size=" & strDefaultFontSize & " color=" & strHeadFontColor & "><b>" & strDate & "</b></font></td></tr>" & vbNewline & vbNewline strMessage = strMessage & "<tr><td bgcolor=#FFFFFF><font face=" & strDefaultFontFace & " size=" & strDefaultFontSize & " color=" & strDefaultFontColor & ">" & strBody1 & "" & vbNewline & vbNewline strMessage = strMessage & "<font face=" & strDefaultFontFace & " size=" & strDefaultFontSize & " color=" & strDefaultFontColor & ">" & strBody2 & "</font><br><br>" & vbNewline & vbNewline strMessage = strMessage & "<font face=" & strDefaultFontFace & " size=" & strFooterFontSize & " color=" & strDefaultFontColor & "><hr width=70% color=#6666CC><ul><li>Your email address " & strRecipients & " is subscribed to the Mangione Magic Newsletter.</li><li>If you wish to unsubscribe from this newsletter you may <a href=" & strForumURL & "nldeactivate.asp?email=" & strRecipients & "&userid=" & strUserID & ">click here</a>.</li><li>By clicking on the above link you will automatically be removed from the Mangione Magic Newsletter.</li></ul>" & strBody3 & "" & vbCrLf & vbCrLf & "</font></font></td></tr></table></td></tr></table>" & vbNewline & vbNewline %> <!--#INCLUDE FILE="inc_mail_html.asp" --> <% if strRecipients <> "" then if Err.Number = 0 then Response.Write " <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strDefaultFontColor & """>Message sent to: " & strRecipients & "" & vbNewLine & _ " <hr width=""50%"" color=""" & strHeadCellColor & """>" & vbNewLine iSuccess = iSuccess + 1 else Response.Write "<table width=""95%"" border=""0"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewLine & _ " <tr>" & vbNewLine & _ " <td bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _ " <table width=""100%"" border=""0"" cellspacing=""1"" cellpadding=""1"">" & vbNewLine & _ " <tr>" & vbNewLine & _ " <td height=""27"" align=""center"" colspan=""2"" bgcolor=""" & strForumCellColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strDefaultFontColor & """>Send Failure...Error was " & Err.Number & " - " & Err.Description & " User: " & strRecipients & "<BR>" & vbNewLine & _ " </td>" & vbNewLine & _ " </tr>" & vbNewLine & _ " </table>" & vbNewLine & _ " </td>" & vbNewLine & _ " </tr>" & vbNewLine & _ "</table>" & vbNewLine iFail = iFail + 1 end if end if rsMail.MoveNext Loop end if rsMail.Close Set rsMail = Nothing Response.Write "<FORM>" & vbNewLine &_ " <br><input TYPE=""BUTTON"" VALUE=""Go Back"" class=""button"" onClick=""history.back()"">" & vbNewLine &_ "</FORM>" & vbNewLine Else %> <!--#include file="inc_code_html.asp" --> <% Response.Write "<table align=""center"" border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""0"">" & vbNewLine &_ " <tr>" & vbNewLine &_ " <td bgcolor="""& strTableBorderColor &""">" & vbNewLine &_ " <FORM action=""nlEmail_List_html.asp"" name=""PostTopic"" method=POST onSubmit=""return confirmAction()"">" & vbNewline & _ " <input type = ""hidden"" name=""NLTopic"" value=""Complete"">" & vbNewLine & _ " <table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""3"">" & vbNewLine &_ " <TR>" & vbNewLine &_ " <TD colspan=""2"" align=""center"" bgColor="""& strHeadCellColor &""" nowrap width=""100%"">" & vbNewLine &_ " <font face="""& strDefaultFontFace &""" size="""& strDefaultFontSize &""" color="""& strHeadFontColor &"""><B>"& strForumTitle &" NEWSLETTER FORM MAILER</B></font>" & vbNewLine &_ " </TD>" & vbNewLine &_ " </TR>" & vbNewLine &_ " <TR>" & vbNewLine &_ " <TD width=""30%"" bgColor="""& strForumCellColor &""" align=right><font face="""& strDefaultFontFace &""" size="""& strDefaultFontSize &""" color="""& strDefaultFontColor &"""><b>From:</b></font></TD>" & vbNewLine &_ " <TD bgColor="""& strForumCellColor &""" valign=top><input type=""text"" name=txtFrom size=58 value="""& strEmailFrom &"""></TD>" & vbNewLine &_ " </TR>" & vbNewLine &_ " <TR>" & vbNewLine &_ " <TD bgColor="""& strForumCellColor &""" align=right><font face="""& strDefaultFontFace &""" size="""& strDefaultFontSize &""" color="""& strDefaultFontColor &"""><b>To:</b></font></TD>" & vbNewLine &_ " <TD bgColor="""& strForumCellColor &""" valign=top><font face=""Arial"" size=2>"& strTo &"</font></TD>" & vbNewLine &_ " </TR>" & vbNewLine &_ " <TR>" & vbNewLine &_ " <TD bgColor="""& strForumCellColor &""" align=right><font face="""& strDefaultFontFace &""" size="""& strDefaultFontSize &""" color="""& strDefaultFontColor &"""><b>Subject:</b></font></TD>" & vbNewLine &_ " <TD bgColor="""& strForumCellColor &""" valign=top><input type=""text"" name=txtSubject size=58 value="""& strForumTitle&" Newsletter for "& Date()&"""></TD>" & vbNewLine &_ " </TR>" & vbNewLine &_ " <TR>" & vbNewLine &_ " <TD colspan=""2"" bgColor="""& strForumCellColor &""" align=""center""><font face="""& strDefaultFontFace &""" size="""& strDefaultFontSize &""" color="""& strDefaultFontColor &""">" & vbNewLine &_ " <br>This is the start of the NewLetter and a basic layout of what it will look like once emailed.<br><br>" & vbNewLine &_ " The Header: and Cell: areas below are shown in the same colors as what will show up in an email.<br><br>" & vbNewLine &_ " The Main Body of Newsletter: is the only text area which is supported by the Post Buttons" & vbNewLine &_ " <br><br>" & vbNewLine &_ " </font></TD>" & vbNewLine &_ " </TD>" & vbNewLine &_ " </TR>" & vbNewLine &_ " <TR>" & vbNewLine &_ " <TD bgColor="""& strHeadCellColor &""" align=right><font face="""& strDefaultFontFace &""" size="""& strDefaultFontSize &""" color="""& strHeadFontColor &"""><b>Header:</b></font></TD>" & vbNewLine &_ " <TD bgColor="""& strHeadCellColor &""" valign=top>" & vbNewLine &_ " <input type=""text"" size=58 name=txtHead value="""& strHead &""">" & vbNewLine &_ " </TD>" & vbNewLine &_ " </TR>" & vbNewLine &_ " <TR>" & vbNewLine &_ " <TD bgColor="""& strCategoryCellColor &""" align=right valign=top><font face="""& strDefaultFontFace &""" size="""& strDefaultFontSize &""" color="""& strCategoryFontColor &"""><b>Cell:</b></font></TD>" & vbNewLine &_ " <TD bgColor="""& strCategoryCellColor &""" valign=top>" & vbNewLine &_ " <textarea rows=2 cols=50 name=txtCell wrap=on>"& strCell &"</textarea>" & vbNewLine &_ " </TD>" & vbNewLine &_ " </TR>" & vbNewLine &_ " <TR>" & vbNewLine &_ " <TD bgColor="""& strForumCellColor &""" align=right valign=top><font face="""& strDefaultFontFace &""" size="""& strDefaultFontSize &""" color="""& strDefaultFontColor &"""><b>Newsletter Date:</b></font></TD>" & vbNewLine &_ " <TD bgColor="""& strForumCellColor &""" valign=top>" & vbNewLine &_ " <textarea rows=2 cols=50 name=txtDate wrap=on>"& strDate &"</textarea>" & vbNewLine &_ " </TD>" & vbNewLine &_ " </TR>" & vbNewLine %> <!--#INCLUDE file="inc_post_buttons_html.asp" --> <% Response.Write" <TR>" & vbNewLine &_ " <TD bgColor="""& strForumCellColor &""" align=right valign=top><font face="""& strDefaultFontFace &""" size="""& strDefaultFontSize &""" color="""& strDefaultFontColor &"""><b>Main Body of Newsletter:</b><br><br>" & vbNewLine &_ " <b>Mode:</b>" & vbNewLine &_ " <select name=""font"" onChange=""thelp(this.options[this.selectedIndex].value)"">" & vbNewLine &_ " <option value=""1"">Help </option>" & vbNewLine &_ " <option value=""2"">Prompt </option>" & vbNewLine &_ " <option selected value=""0"">Basic </option>" & vbNewLine &_ " </select><br><br>" & vbNewLine &_ " <input name=""Preview"" type=""button"" value="" Preview "" onclick=""OpenPreview()"">" & vbNewLine &_ " </font></TD>" & vbNewLine &_ " <TD bgColor="""& strForumCellColor &""" valign=top>" & vbNewLine &_ " <textarea cols=""50"" name=""Message"" rows=""15"" wrap=""VIRTUAL"" onfocus=""getActiveText(this)"" onclick=""getActiveText(this)"" onchange=""getActiveText(this)"">"& strBody1 &"</textarea>" & vbNewLine &_ " </TD>" & vbNewLine &_ " </TR>" & vbNewLine &_ " <TR>" & vbNewLine &_ " <TD bgColor="""& strForumCellColor &""" align=right valign=top><font face="""& strDefaultFontFace &""" size="""& strDefaultFontSize &""" color="""& strDefaultFontColor &"""><b>Closing Message:</b></font></TD>" & vbNewLine &_ " <TD bgColor="""& strForumCellColor &""" valign=top>" & vbNewLine &_ " <textarea rows=4 cols=50 name=txtBody2 wrap=on>"& strBody2 &"</textarea>" & vbNewLine &_ " </TD>" & vbNewLine &_ " </TR>" & vbNewLine &_ " <TR>" & vbNewLine &_ " <TD bgColor="""& strForumCellColor &""" align=right valign=top><font face="""& strDefaultFontFace &""" size="""& strDefaultFontSize &""" color="""& strDefaultFontColor &"""><b>Copyright/Footer:</b></font></TD>" & vbNewLine &_ " <TD bgColor="""& strForumCellColor &""" valign=top>" & vbNewLine &_ " <textarea rows=5 cols=50 name=txtBody3 wrap=on>"& strBody3 &"</textarea>" & vbNewLine &_ " </TD>" & vbNewLine &_ " </TR>" & vbNewLine &_ " <TR>" & vbNewLine &_ " <TD bgColor="""& strForumCellColor &""" align=center valign=top colspan=""2"">" & vbNewLine &_ " <INPUT type=""submit"" value=""Test Newsletter!"" name=""Submit""><br><br>" & vbNewLine &_ " <INPUT type=""submit"" value=""Send Newsletter!"" name=""Submit""><br><br>" & vbNewLine &_ " <font face="""& strDefaultFontFace &""" size="""& strFooterFontSize &""" color="""& strDefaultFontColor &""">" & vbNewLine &_ " If you have a really long mailing list<BR>" & vbNewLine &_ " it may take a few minutes for the system <BR>" & vbNewLine &_ " to send a message to everyone.<BR>" & vbNewLine &_ " <font color="""& strHoverFontColor &""">CLICK ""Send Newsletter!"" <b><U>ONLY ONCE</U></b> AND PLEASE BE PATIENT!</font>" & vbNewLine &_ " </font></P>" & vbNewLine &_ " </TD>" & vbNewLine &_ " </TR>" & vbNewLine &_ " </TABLE>" & vbNewLine &_ " </TD>" & vbNewLine &_ " </TR>" & vbNewLine &_ " </TABLE>" & vbNewLine &_ "</FORM>" & vbNewLine end if WriteFooter Else scriptname = split(request.servervariables("SCRIPT_NAME"),"/") Response.Redirect "admin_login.asp?target=" & scriptname(ubound(scriptname)) End IF %>
quote:Originally posted by CarefreeIt works fine here ... you're using the Test button and it's sending to everyone? You didn't change anything?