Jmail Object

Oct 05 at 9:20am - admin
Page one - MailForm.asp
This sample shows how you can add all the elements in a form to your email.
<form method="post" action="SendMail.asp">
Name <INPUT name="name" type="text"><br>
Email<INPUT name="Email" type="text"><br>
Company<INPUT name="company" type="text"><br>
Occupation <SELECT name="state">
<OPTION value="coder">Coder
<OPTION value="coder">Hacker
<OPTION value="coder">Developer
<OPTION value="coder">Guru
Favorite TV-show<TEXTAREA name="tv-show"></TEXTAREA>
<INPUT type="submit" value= "Send">

Page two - SendMail.asp
Set JMail = Server.CreateObject("JMail.SMTPMail")
' This is my local SMTP server
JMail.ServerAddress = ""
' This is me....
JMail.Sender = " "
JMail.Subject = "Here you go..."
' Get the recipients mailbox from a form (note the lack of a equal sign).
JMail.AddRecipient " "
JMail.Priority = 1
JMail.body = "The form was filled out with the following values:" & vbcrlf
Dim el
'add every form element and its value to the email
FOR EACH el IN Request.Form
JMail.appendtext( el & ": " & Request.form(el) & vbcrlf )
' Send it...
An e-mail has been sent to your mailbox (<%=request.form("email")%>).