Emmasvej 2-10 - Brabrand
<%
Dim vPath, pPath, ConString, sqltext1, rsBlogliste, rsBrugerliste
vPath = "../db/emmasvej.mdb" 'use this one if database is in root of cart folder
pPath = Server.MapPath( vPath )
ConString = "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & pPath & ";"
Function unQuote(strTekst)
unQuote = Replace(strTekst,"'","''")
End Function
Sub Brugerliste
sqltext1 = "SELECT * from Brugere order by Navn"
'response.write(sqltext1)
set rsBrugerliste = Conn.Execute(sqltext1)
End Sub
Sub afsendmail (nTo, nBcc, nSubject, nTekst, nMailformat)
Dim sMsg
Dim sTo
Dim sBcc
Dim sFrom
Dim sSubject
Dim sTextBody
sTo = nTo
if (sTo = "") then
sTo = "info@emmasvej.dk"
end if
sBcc = nBcc
sFrom = "info@emmasvej.dk"
sSubject = nSubject
sTextBody = nTekst
Dim objMail
'Create the mail object
Set objMail = Server.CreateObject("CDO.Message")
'Set key properties
objMail.From = sFrom
objMail.To = sTo
objMail.Bcc = sBcc
objMail.Subject= Replace(sSubject,"''","'")
If (nMailformat = "TEXT") then
'Alm. ukodet brødtekst
objMail.TextBody = Replace(sTextBody,"''","'")
else
'HTML kodet brødtekst
objMail.HTMLBody = Replace(sTextBody,"''","'")
end if
'The line below shows how to send a webpage from a remote site
'objMail.CreateMHTMLBody "http://www.emmasvej.dk/blog/blog.asp"
'The line below shows how to send a webpage from a file on your machine
'objMail.CreateMHTMLBody "file://c|/temp/test.htm"
'Send the email
objMail.Send
'Clean-up mail object
Set objMail = Nothing
response.write "E-mail succesfully sent!"
End Sub
'Main program
chaAktion = unQuote(Request.form("Aktion"))
chaCurItem1 = Request.form("CurItem1")
chaTo = unQuote(Request.form("To"))
chaBcc = unQuote(Request.form("Bcc"))
chaSubject = unQuote(Request.form("Subject"))
chaTekst = unQuote(Request.form("Tekst"))
chaMailformat = unQuote(Request.form("Mailformat"))
set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open ConString
if (chaAktion = "send") then
afsendmail chaTo, chaBcc, chaSubject, chaTekst, chaMailformat
Response.redirect "blog.asp"
end if
%>
<%
if (Len(Session("Brugerid")) > 0) then
response.write "