Den kommer her :)
-----
<!-- #include file = "protect.inc" -->
<!-- #include file = "dbConn.inc" -->
<!-- #include file = "email_sender.asp" -->
<!-- #include file = "email_validator.asp" -->
<%
text = Request.Form("text")
emailFormat = Request.Form("emailFormat")
testEmail = Request.Form("testEmail")
recepients = Request.Form("recepients")
showMessage = Request.Form("showMessage")
emails = ""
message = ""
counter = 1
If text <> "" Then
If recepients = "test" And Not isEmailValid(testEmail) Then
message = "<font face=verdana size=2 color=#ff0000>Mangler information omkring test email.</font><br>"
End If
If recepients = "test" And isEmailValid(testEmail) Then
fromMail = "bestyrelsen@sagahus.dk"
subject = "AB Sagahus E-infobrev"
sendEmail fromMail, testEmail, "", "", subject, text, emailFormat
message = "<font face=verdana size=2 color=#ff0000>Test mailen er nu sendt.</font><br>"
End If
If recepients = "all" Then
oConn.execute("Insert Into newsletters (text) Values ('" & text & "')")
Set oRS = oConn.execute("Select email from newsletter_members where activated_date is not null")
Do While Not oRS.EOF
emails = emails & oRS.Fields("email")
If counter < oRS.RecordCount Then
emails = emails & ";"
End If
counter = counter + 1
oRS.MoveNext
Loop
toMail = "bestyrelsen@sagahus.dk"
fromMail = "bestyrelsen@sagahus.dk"
subject = "AB Sagahus E-infobrev"
sendEmail fromMail, toMail, "", emails, subject, text, emailFormat
message = "<font face=verdana size=2 color=#ff0000>Nyhedsbrevet er nu sendt.</font><br>"
End If
Else
message = "<font face=verdana size=2 color=#ff0000>Ingen tekst defineret.</font><br>"
End If
%>
<html>
<head>
<title>AB Sagahus' nyhedsbrev</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" src="../js/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
plugins : "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,imagemanager,filemanager",
convert_urls : false,
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
// Example content CSS (should be your site CSS)
content_css : "css/example.css",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "js/template_list.js",
external_link_list_url : "js/link_list.js",
external_image_list_url : "js/image_list.js",
media_external_list_url : "js/media_list.js",
// Replace values for the template plugin
template_replace_values : {
username : "saga",
staffid : "1"
}
});
</script>
</head>
<body>
<!-- #include file = "menu.inc" -->
<h1>Velkommen til AB Sagahus' nyhedsbrev</h1><p>
<h2>PÂ denne side kan du sende nyhedsbrevet</h2><p>
<form name="send_newsletter" action="send_newsletter.asp" method="POST">
<input type="hidden" name="showMessage" value="1">
<table>
<tr>
<td colspan="2"><%If len(message) > 0 And showMessage = "1" Then Response.Write message End If%></td>
</tr>
<tr>
<td>HTML: <input type="radio" name="emailFormat" value="html" <%If emailFormat <> "text" Then Response.Write("checked")%>></td>
<td>Text: <input type="radio" name="emailFormat" value="text" <%If emailFormat = "text" Then Response.Write("checked")%>></td>
</tr>
<tr>
<td>Send til alle tilmeldte: <input type="radio" name="recepients" value="all" <%If recepients = "all" Then Response.Write("checked")%>></td>
<td>Send test email: <input type="radio" name="recepients" value="test" <%If recepients <> "all" Then Response.Write("checked")%>></td>
</tr>
<tr>
<td>Test email adresse:</td>
<td><input type="text" name="testEmail" size="25" maxlength="50" value="<%If testEmail = "" Then Response.Write("bestyrelsen@sagahus.dk") Else Response.Write(testEmail) End If%>"></td>
</tr>
<tr>
<td colspan="2"><textarea name="text" cols="75" rows="30">Hvis du ikke kan lÊse dette nyhedsbrev, bedes du logge ind pÂ
www.administrationdanmark.dk og lÊse det der. Der kan g en dag eller to inden nyhedsbrevet er tilgÊngeligt hos Administration Danmark. Du kan altid afmelde nyhedsbreve fra AB Sagahus pÂ
www.sagahus.dk.</textarea></td> </tr>
<tr>
<td colspan="2"><input type="submit" name="submit" value="Send!"></td>
</tr>
</table>
</form>
</body>
</html>
<!--#include file="dbClose.inc"-->