How to send info from JSP page as email-body

Hi,
i have a JSP page that generates dynamically as a result of some query. I have a Button - "Send Email".
I want to send the information to the receipient thru email automatically on a button click,
All information is in the memory. How can we pick the info from memory and send it as a message thru email?
Pls help.
thanx & regards,
Shalini

create a servlet to send mail (use the JavaMail api) then Post the message to the servlet when you click on the button.
OR, put the message and any other data (like the email address) into the session, and then just call the servlet on click of the button, and have the servlet retrieve the information from the session.

Similar Messages

  • How to print report from JSP Page

    Hi Everybody,
    I am developing a simple project in JSP with MS Access. I hav some tables and reports for them. I hav a JSP page which gets inputs from user and save it in the table. Its working fine. But my problems are,
    1) I hav a button called "SAVE & PRINT" in that bottom of the page, if i click that button, the currently entered data has to save in the table and the same data has to print from the MS Access report. I dont know how to print this report from JSP page.
    2) Another button called "REPRINT". If i click that button, it has to ask a number to print the report page, that number is nothing but a field in that report.
    Could anyone help me to solve this problem.

    Hi Everybody,
    I am developing a simple project in JSP with MS Access. I hav some tables and reports for them. I hav a JSP page which gets inputs from user and save it in the table. Its working fine. But my problems are,
    1) I hav a button called "SAVE & PRINT" in that bottom of the page, if i click that button, the currently entered data has to save in the table and the same data has to print from the MS Access report. I dont know how to print this report from JSP page.
    2) Another button called "REPRINT". If i click that button, it has to ask a number to print the report page, that number is nothing but a field in that report.
    Could anyone help me to solve this problem.

  • How to call Servlet from jsp page and how to run this app using tomcat..?

    Hi ,
    I wanted to call servlet from jsp action i.e. on submit button of JSP call LoginServlet.Java file.
    Please tell me how to do this into jsp page..?
    Also i wanted to execute this application using tomcat.
    Please tell me how to do this...? what setting are required for this...? what will be url ..??
    Thanks.

    well....my problem is as follows:
    whenever i type...... http://localhost:8080/appName/
    i am getting 404 error.....it is not calling to login.jsp (default jsp)
    but when i type......http://localhost:8080/appName/login.do........it executes servlet properly.
    Basically this 'login.do' is form action (form action='/login.do').....and i wanted to execute this from login jsp only.(from submit button)
    In short can anyone please tell me how to diaplay jsp page using tomcat 5.5
    plz help me.

  • How to send SMS from JSP application.

    Hi,
    I have created a web application using JSP for our Office internal use. I want to include the folowing option in our app.
    1) How to send SMS from the application to mobile.
    2) I don't want to use third party service (ex: SimpleWire). as the app is for internal purpose only.
    It will be helpful, if I get the complete procedure to implement it, as this is my first application.
    Thanks & Regards
    suresh.

    I am having problem with smslib. smslib is an enhanced version of jsmengine, I have compiled the program, there is no error but when I run it , the following error is found. Can you help? my email is [email protected]
    Exception in thread "main" java.lang.NoClassDefFoundError: CIncomingMessage (wrong name: org/smslib/CIn
    comingMessage)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

  • Send message from JSP page to Java message driven bean

    Hi all
    I'm using Jdev903.
    I need to send a message from JSP page (Web Application) to Java Message Driven Bean.
    * I created Message Driven Bean that named: MyMessageDrivenEJBBean
    * I have configed jms.xml:
    <topic-connection-factory name="ChatTopicConnectionFactory" location="jms/theTopicConnectionFactory"/>
    <topic name="ChatTopic" location="jms/theTopic"/>
    * In JSP page, my code is:
    final Context ctx = new InitialContext();
    // 1: Lookup ConnectionFactory via JNDI
    TopicConnectionFactory factory =(TopicConnectionFactory)ctx.lookup("jms/theTopicConnectionFactory");
    But trouble occurs is:
    javax.naming.NameNotFoundException: jms/theTopicConnectionFactory not found
    please help me!
    thank a lot.

    Welcome to the Sun forums.
    1. Please post your code using code tags, this formats it so that it is easier for people to read and understand it. Click on 'CODE' above the text area when posting.
    2. As far as possible, please post an SSCCE
    What have learnt about JSPs and servlets till now? Because reading the values submitted in a form is pretty much the base of all operations. I suggest you Google for [servlet tutorials|http://www.google.com/search?q=servlet+tutorial] and [JSP tutorials|http://www.google.com/search?q=jsp+tutorial] and go through them thoroughly. After you understand what is to be done and what options are available to you, if you still face problems, please feel free to post your queries here. But this isn't exactly a site for tutorials, especially since there are so many good ones already out there, that explain all this stuff in detail. There's no point in re-inventing the wheel.
    Hints: [ServletRequest#getParameter()|http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletRequest.html#getParameter(java.lang.String)] and [RequestDispatcher#forward|http://java.sun.com/javaee/5/docs/api/javax/servlet/RequestDispatcher.html]

  • How to send sms from jsp

    how to send sms from jsp

    First of all, you need to have the gsm modem or access to any Telco sms gateway.
    If you don have any access to the Telco sms gateway, try to download the SMSLib-Java-v2.1.2 java library from the http://sourceforge.net/project/showfiles.php?group_id=164313.
    Edit the example in the download file and include the example in your JSP file to send the sms using GSM modem.

  • How to send information from HTML page to JSP without reloading HTML page?

    Hello,
    Is it possible to send information(row number selected by user) from HTML page to JSP without reloading HTML page?
    Thanks.
    Oleg.

    Yes, you can do this with framesets and a hidden frame.
    You need a bit of JavaScritp in the "visible" frame that
    sets the location of the hidden frame to the JSP.
    Add the user's choice as a parameter to the JSP URL.

  • How to send mail from jsp

    hi,
    i want to send mail from my jsp page.
    1) how can i do this
    2) do i need any mail server for doin this
    thanks
    regards
    manoj

    i want to send mail from my jsp page.
    1) how can i do this
    2) do i need any mail server for doin thisRead
    http://java.sun.com/developer/onlineTraining/JavaMail/
    Rather,
    try this:
    http://jakarta.apache.org/taglibs/doc/mailer-doc/mailer-1.1/index.html

  • How to send List from jsp to action class

    hi,
    i m fetching list from database and showing to jsp as follows:
    user can update that list i need to collect that updated list in next action class but i m not able to do that. can anybody suggest me any solution the code i m using is as follows:
    <html:form action="/myUpdate">
    <table>
    <tr>
         <td>
              <label><input type="text" property="name" name="name" value=""/></label>
         </td>
    </tr>
    <logic:iterate id="address" name="info" property="addressList" indexId="rowindex">
         <tr>
         <td>
         <input type="text" value="" name="address[<bean:write name="rowindex"/>].houseno" />
         </td>
         <td>
         <input type="text" value="" name="address[<bean:write name="rowindex"/>].roadname" />
         </td>
         <td>
         <input type="text" value="" name="address[<bean:write name="rowindex"/>].city" />
         </td>
         <td>
         <input type="text" value="" name="address[<bean:write name="rowindex"/>].state" />
         </td>
         <td>
         <input type="text" value="" name="address[<bean:write name="rowindex"/>].country" />
         </td>
         </tr>
         </logic:iterate>
    <tr>
         <html:submit/>
    </tr>
    </table>
    </html:form>
    here in privious action i m settting bean object in session with name 'info'. it is fetching data and disply it correctly but when i m trying to get this updated data in myUpdate action i m not getting list element.

    --------------- MyBean.java----------------------
    package form;
    import java.util.Iterator;
    import java.util.List;
    import javax.servlet.http.HttpServletRequest;
    import org.apache.log4j.Logger;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionMapping;
    * @author Sushant.Raut
    public class MyBean extends ActionForm {
         Logger log = Logger.getLogger(this.getClass());
         /* (non-Javadoc)
          * @see org.apache.struts.action.ActionForm#reset(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest)
         @Override
         public void reset(ActionMapping mapping, HttpServletRequest request) {
              // TODO Auto-generated method stub
              super.reset(mapping, request);
              this.name = "";
         public String toString()
              System.out.println("name : " + this.name );
              for(Iterator<Address> iterator = addressList.iterator(); iterator.hasNext();)
                   Address address = (Address)iterator.next();
                   System.out.println("city : " + address.getCity());
              return null;
         private static final long serialVersionUID = 1L;
         private String name;
         private List<Address> addressList;
          * @return the names
         public MyBean()
              log.info("Bean Construtor is called.");
              System.out.println("MyBean:::::constructor is called.");
         public String getName() {
              log.info("Bean getName() is called");
              return name;
          * @param names the names to set
         public void setName(String name) {
              this.name = name;
              log.info("Bean setName() is called");
          * @return the address
         public List<Address> getAddressList() {
              log.info("Bean getAddressList() is called");
              return addressList;
          * @param address the address to set
         public void setAddressList(List<Address> address) {
              log.info("Bean setAddressList() is called");
              this.addressList = address;
         public Address getAddress(int index)
              log.info("Bean getAddress(int index) is called");
              while(index >= addressList.size())
                   addressList.add(new Address());
              return this.addressList.get(index);
         public void setAddress(int index, Address address)
              log.info("Bean setAddress(int index, Address address)) is called");
              this.addressList.add(index, address);
    }------------- Address.java------------
    package form;
    import javax.servlet.http.HttpServletRequest;
    import org.apache.struts.action.ActionMapping;
    * @author Sushant.Raut
    public class Address {
         private String houseno;
         private String roadname;
         private String city;
         private String state;
         private String country;
         public Address(){}
          * @return the houseno
         public String getHouseno() {
              return houseno;
          * @param houseno the houseno to set
         public void setHouseno(String houseno) {
              this.houseno = houseno;
          * @return the roadname
         public String getRoadname() {
              return roadname;
          * @param roadname the roadname to set
         public void setRoadname(String roadname) {
              this.roadname = roadname;
          * @return the city
         public String getCity() {
              return city;
          * @param city the city to set
         public void setCity(String city) {
              this.city = city;
          * @return the state
         public String getState() {
              return state;
          * @param state the state to set
         public void setState(String state) {
              this.state = state;
          * @return the country
         public String getCountry() {
              return country;
          * @param country the country to set
         public void setCountry(String country) {
              this.country = country;
         public void reset(ActionMapping mapping, HttpServletRequest request)
              this.city = "";
              this.country = "";
              this.houseno = "";
              this.roadname = "";
              this.state = "";
    }------ MyAction.java------
    package action;
    import java.util.ArrayList;
    import java.util.List;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.log4j.Logger;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import form.Address;
    import form.MyBean;
    * @author Sushant.Raut
    public class MyAction extends Action {
         Logger log = Logger.getLogger(this.getClass());
         public ActionForward execute(ActionMapping mapping, ActionForm form,
                   HttpServletRequest request, HttpServletResponse response)throws Exception{
              MyBean myBean = new MyBean();
              log.info("Bean is Initialised.");
              String name = "sushant";
              Address address = new Address();
              address.setCity("city1");
              address.setCountry("India");
              address.setHouseno("1111");
              address.setRoadname("xyz Road");
              address.setState("MH");
              Address address1 = new Address();
              address1.setCity("Hyderabad");
              address1.setCountry("India");
              address1.setHouseno("2222");
              address1.setRoadname("ABC Road");
              address1.setState("AP");
              List<Address> addressSet = new ArrayList<Address>();
              addressSet.add(address);
              addressSet.add(address1);
              myBean.setName(name);
              myBean.setAddressList(addressSet);
              request.getSession().setAttribute("info", myBean);
              log.info("Bean is bound to session.");
              System.out.println("MyBean object is bound to session.");
              System.out.println(myBean);
              return mapping.findForward("success");
    }-------- show.jsp-----------
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
         <html:form action="/myUpdate">
              <table>
                   <tr>
                        <td>
                             <label><html:text property="name" name="info"/></label>
                        </td>
                   </tr>
                   <logic:iterate id="address" name="info" property="addressList" indexId="rowindex">
                        <tr>
                             <td>
                                  <html:text property="houseno" name="address" indexed="true"/>
                             </td>
                             <td>
                                  <html:text property="roadname" name="address" indexed="true"/>
                             </td>
                             <td>
                                  <html:text property="city" name="address" indexed="true"/>
                             </td>
                             <td>
                                  <html:text property="state" name="address" indexed="true"/>
                             </td>
                             <td>
                                  <html:text property="country" name="address" indexed="true"/>
                             </td>
                        </tr>
                   </logic:iterate>
                   <tr>
                        <html:submit title="Submit"/>
                   </tr>
              </table>
         </html:form>
    </body>
    </html>

  • Send mail from JSP page

    Hello,
    can some one help me to send emails from a jsp page.
    and if possible the source code of jsp or java...
    Thanks !

    read this:
    http://www.jspinsider.com/tutorials/jsp/javamail/jspjavamail_1.view

  • How to send info from Win32 Application to C# application

    I develop two separate application Win32 and C# (WPF). I would like to send some info (such as a list of words) from Win32 application to a window in C# application. How to do this?
    We have SendMessage and PostMessage Win API but not sure how to catch these messages from C# application's window. Or do we have other methods to send info to C#?
    Actually I would like to send a list of words from Text Service (Win32) to a keyboard (C#-WPF).
    Thanks,
    ntquy99

    Hi,
    This may be funny but may work and meet your requirement.
    http://www.c-sharpcorner.com/UploadFile/6f0898/simple-way-to-establish-interaction-between-two-visual-studi/
    Here I used To communicate Two Different Window Forms application using a text file as communication mode to as a connection database
    Regards,
    Selva Ganapathy K
    Thank you Selva. Your solution is to polling the update from another application.
    My situation is a little different. I just simply want to send message/info from Win32 app to C# app and wonder how to do this?

  • Sending mail from JSP page

    HI Everyone,
    Please help me out in this. It is very urgent so not able search the same in this forum.
    I have a J2EE application. The view is in JSP. If i click a button from a JSP page, any mail client (Microsoft Outlook) has to open and current page need to be attached as html. THen user wish to send the mail to somebody...
    So my aim is to open a outlook and attache the current JSP page as html. PLease help me out !

    Instead of outlook, you can do it easily using SMTP

  • Sending mail from JSP page with attachment

    I have a requirement to send mail with attachment from my jsp pages, which should come to a particular mail box. Can any one help me by sending sample codes. Thankx in advance.

    hi,
    When request is posted you have to save file data from request to a file. you can not access the data using request.getParameter("file").

  • How to catch ClassCastException from JSP page?

    I get a ClassCastException within my JSP page and I know where my bug is. However, this classcastexception message is displayed in the browser and I want to catch this exception to also log it into my log file. But I can't find the place where to catch it: in my servlet's doPost() method I can't catch it - i tried it by enclosing the method body with try/catch but it isn't catched. I wonder if I can catch it at all or if this error is handled internally in the servlet engine?

    It should only be displayed in the browser if you're not catching the exception in the jsp itself. If the exception is happening in the jsp, then there's no point in trying to catch it in the servlet.
    What happens if you put a try-catch just around the actual code in the jsp? You could put it around the entire jsp, but that's not necessary.
    One problem I've encountered in catching exceptions is if there are escape sequences within the try block, for example:
    try{
       //java code
    %>
       <!--html -->
    <%
    //java
    catch (Exception e)I'm not sure if that works or not, but to be safe, make sure you're not escaping from jsp within the try block.

  • How to run servlet from JSP page

    A simple JSP page,where I will put a button.And on clicking..it will invoke the servlet and the servlet will send the result to the jsp page...
    Please give the instructions with examples...
    Thanks in advance...

    hi,
    Create a jsp inside webapps/root
    <a href="./howtocode" > click to call servlet </a>and follow the steps
    http://forum.java.sun.com/thread.jspa?threadID=5202830

Maybe you are looking for

  • Bounce the standby database

    Hello, I am using oracle10g with standby database. Here is the database version. Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi PL/SQL Release 10.2.0.3.0 - Production CORE 10.2.0.3.0 Production TNS for Linux: Version 10.2.0.3.0 - Pr

  • Problem in using connection pool in netbeans

    Hi, I am using Net Beans and Sun java application server and Derby as database. I have created data connnection and also configure JDBC resources (ie. DataResource and connectionPool). Now i want to use this connection pool in my class, I have create

  • How to add favicon to webcenter portal project

    Hi All, I am using jdeveloper version 11.1.1.6.0. We have developed webcenter portal application . I want to set favicon(browser icon) for all pages in my application . I put favicon in Web Content folder and run in local jdeveloper (integrated weblo

  • EAS Data Load Problem - Very Strange!

    Hi there,<BR><BR>Has anyone came across the following problem?<BR><BR>Within EAS using any of our applications, or a newly created application, if we create a new rule's file (or open an existing) that much is fine.<BR><BR>However - as soon as we try

  • IPod with clicking wheel help needed

    I went to turn on my iPod today and when i turned it on the Apple came up on the screen, but when it should have gone to the menu screen, the screen just shuts off. My ipod has a full charge and i use it almost everyday. Has anyone else experienced t