• hessian
  • quercus/php
  • resin 3.0
  • resin 3.1
  • resin 4.0

  • changes
  • configuration
  • examples
  • installing
  • overview
  • starting

  • guide: admin
  • admin
  • amber
  • bam
  • caching
  • clustering
  • comet
  • database
  • deployment
  • ejb 3.0
  • embedding
  • filters
  • ioc
  • jsf
  • jsp
  • logging
  • messaging
  • quercus
  • remoting
  • security
  • resources
  • servlets
  • third-party
  • troubleshooting
  • virtual host
  • watchdog
  • webapp
  • HOME
  • ABOUT
  • ARTICLES
  • WORKSPACE
  • NEWS
  • PROJECTS
  • PRODUCTS
  • STORE
resin example $resin/java_tut/mail_form.xtp A convenient way of gathering form data is simply to mail the form results to a mailbox A convenient way of gathering form data is simply to mail the form results to a mailbox. Resin supports sending mail with it's Virtual File System.

A convenient way of gathering form data is simply to mail the form results to a mailbox. Mail is the most effective push technology.

Sending mail with Resin is just like writing to a file. Resin recycles APIs to reduce information pollution. Its VFS (virtual file system) extends and simplifies java.io. Sending mail is just like writing to a file. Resin's Path class is like File and its WriteStream is a combination of OutputStream and PrintWriter.

<%@ page language=java %> <%@ page import='com.caucho.vfs.*' %> <%@ page import='java.util.*' %> <% Path mail; mail = Vfs.lookup("mailto:survey?subject='Colors'"); WriteStream os = mail.openWrite(); Enumeration e = request.getParameterNames(); while (e.hasMoreElements()) { String key = (String) e.nextElement(); String value = request.getParameter(key); os.println(key + ": " + value); } os.close(); %> <h1>Thank you for your response.</h1> name: Kermit the Frog color: green

The example mails results to a user named survey on the web server. The subject of the mail is Colors. Scripts can add their own mail headers, including cc, bcc, and even from. To add multiple headers, separate them by &.

Vfs.lookup("mailto:you?subject=test&bcc=me");
  • HOME |
  • CONTACT US |
  • DOCUMENTATION |
  • SALES |
  • WIKI
Copyright (c) 1998-2009 Caucho Technology, Inc. All rights reserved.
caucho® , resin® and quercus® are registered trademarks of Caucho Technology, Inc.