see www.funmail.co.uk
we did all that with jsp
Ethan Henry wrote:
> > Jacob Madsen wrote:
> >
> > Anyone know of a free Java bean to send e-mail from a JSP site, like
> > CDONTS in ASP?
>
> I wrote a sample mail bean for a Web Techniques article on JSP.
> See the November (current) issue.
>
> Here's the code:
>
> // MailBean.java
>
> package ethan;
>
> import java.io.*;
> import sun.net.smtp.*;
>
> public class MailBean {
>
> String sender;
> String recipient;
> String body;
>
> public void setSender(String s) {
> sender = s;
> }
>
> public void setRecipient(String s) {
> recipient= s;
> }
>
> public void setBody(String s) {
> body = s;
> }
>
> /**
> * @returns true if the message was sent, false otherwise
> **/
> public boolean sendMessage() {
> try {
> // replace "smtp" with your own SMTP server's name
> SmtpClient client = new SmtpClient("smtp");
>
> // use the SmptClient instance to construct the message
> client.from(sender);
> client.to(recipient);
> PrintStream msg = client.startMessage();
> msg.println("Subject: Web Feedback");
> msg.println();
> msg.println(body);
> msg.println("--");
> msg.println("Send using MailBean!");
> client.closeServer();
> }
> catch(IOException e) {
> return false;
> }
>
> return true;
> }
>
> }
>
> --
> Ethan Henry [EMAIL PROTECTED]
> Java Evangelist, KL Group http://www.klg.com
> "Software Development Productivity"
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> FAQs on JSP can be found at:
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
--
RemoteApps Ltd.
============================================
enhancing the way you work
============================================
Electronic Publishing | Knowledge Management
Virtual Communities | Electronic Commerce
============================================
http://www.remoteapps.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html