<%
' Get the form data
name = Request.Form("name")
senderEmail = Request.Form("email")
recipient = Request.Form("recipient")
body = Request.Form("body")
' 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 yourself
msg.Logging = true
msg.silent = true
' Enter the sender data
msg.From = senderEmail
msg.FromName = name
' Note that as addRecipient is method and not
' a property, we do not use an equals ( = ) sign
msg.AddRecipient recipient
' The subject of the message
msg.Subject = subject
' And the body
msg.body = body
' Now send the message, using the indicated mailserver
if not msg.Send("mail.domain_name.com" ) then
Response.write "<pre>" & msg.log & "</pre>"
else
Response.write "Message sent succesfully!"
end if
' And we're done! The message has been sent.
%>