|
|
<%
' 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
' Most mailservers require a valid email address
' for the sender
msg.From = "info@mec-wismar.de"
msg.FromName = "mec-wismar.de - Formulare"
' Note that as addRecipient is method and not
' a property, we do not use an equals ( = ) sign
msg.AddRecipient "info@mec-wismar.de", "His Name"
' The subject of the message
msg.Subject = "eMail Kontaktformular"
'add every form element and its value to the email
FOR EACH el IN Request.Form
msg.appendtext( el & ": " & Request.form(el) & vbcrlf )
NEXT
' Now send the message, using the indicated mailserver
if not msg.Send("smtp.mec-wismar.de" ) then
Response.write " " & msg.log & " "
else
Response.write "eMail wurde gesendet!"
end if
' And we're done! the message has been sent.
%> |
|