Joachim.dk
<%
Dim variable
Function unQuote(strTekst)
unQuote = Replace(strTekst,"'","''")
End Function
Sub afsendmail (nFrom, nName, nSubject, nTekst)
Dim sMsg
Dim sTo
Dim sBcc
Dim sFrom
Dim sSubject
Dim sTextBody
sTextBody = "Mailen er fra " & nName & " (" &nFrom & "): " & nTekst & " (IP-adr.: " & Request.ServerVariables("REMOTE_ADDR") & ")"
' Create the JMail message Object
set msg = Server.CreateOBject( "JMail.Message" )
' Set logging to true to ease any potential debugging
' And set silent to true as we wish to handle our errors ourself
msg.Logging = true
msg.silent = true
' Enter the sender data
msg.From = "joachim@joachim.dk"
msg.FromName = "Hjemmesiden"
' Note that as addRecipient is method and not
' a property, we do not use an equals ( = ) sign
msg.AddRecipient "joachim@joachim.dk", "Joachim Neve Noergaard"
' The subject of the message
msg.Subject = nSubject
' And the body
msg.body = sTextBody
' Now send the message, using the indicated mailserver
if not msg.Send("mail.joachim.dk") then
Response.write "
" & msg.log & "
"
else
Response.redirect "../side.asp?PageId=mailsendt"
end if
' And we're done! the message has been sent.
End Sub
'Main program
chaAktion = unQuote(Request.form("Aktion"))
chaCurItem1 = Request.form("CurItem1")
chaFrom = unQuote(Request.form("From"))
chaName = unQuote(Request.form("Name"))
chaBcc = unQuote(Request.form("Bcc"))
chaSubject = unQuote(Request.form("Subject"))
chaTekst = unQuote(Request.form("Tekst"))
chaMailformat = unQuote(Request.form("Mailformat"))
if (chaAktion = "send") then
afsendmail chaFrom, chaName, chaSubject, chaTekst
end if
%>