EMAIL FUNCTION USING JSP

HOW CAN I WRITE A EMAIL FUNCTION USING JSP
WHICH HAVE FORWARD, REPLY, REPLAY ALL, AND ADDRESS BOOK LIKE YAHOO EMAIL FUNCTION
HOW CAN I WRITE IT?

I meant you would face a considerable challenge trying to write
public static void main(String[] arg) { } with your Caps-Lock key stuck.
You would not even be able to escape your way out of it with
\u0070\u0075\u0062\u006C\u0069\u0063 \u0073\u0074\u0061\u0074\u0069\u0063 \u0076\u006F\u0069\u0064 \u006D\u0061\u0069\u006E(S\u0074\u0072\u0069\u006E\u0067[] \u0061\u0072\u0067) { } as the "\u" escape sequence also contains a lowercase character.

Similar Messages

  • Passing values to JavaBean function using jsp scriplet

    Hi,
    I have a JavaBean funtion that is SaveData(parameters)
    which save the values from HTML form.
    Now i want a code for pass the values from HTML form to SaveData() function using jsp scriptlet.
    I used the code
    <jsp:useBean id="JDBC" class="bean.JDBCBean" scope="application"></jsp:useBean>
    <%=JDBC.saveData(phonenumber,manufacturer,model,email,country,newsletter)%>
    Here
    JDBCBean -> Bean Name
    phonenumber,manufacturer,model,email,country,newsletter ->HTML form's text values
    But it didnt work properly.
    Anyone help me to correct this.

    Hi,
    i have the same code like above
    I have to pass the parameters with form name under the following code.
    <jsp:useBean id="JDBC" class="bean.JDBCBean" scope="application"></jsp:useBean>
    <%=JDBC.saveData(registration.phonenumber.value,id_type.value,id_style.value,registration.email.value,registration.scountry.value,player_type.values)%>
    Here
    registration -> HTML form name
    But i got the error for
    package registration does not exist
    out.print(JDBC.saveData(registration.phonenumber.value,id_type.value,id_style.value,registration.email.value,registration.scountry.value,player_type.values));
    How to i correct this?
    Anyone help me......

  • How to write printing function using JSP?

    dear all,
    i want to add a printing function in my project but i do not know how to do it? could anyone teach me how to do it?
    thanks
    eric

    salut eric,
    you can do it this way :
    1 - create a html link in your code to this javascript
    function : (I am using Struts, but you can write it in
    pure html
    <html:link href="#bodyStart"
    onclick="openWindowForPrinting()"
    titleKey="msg.status.print">      <bean:message
    key='app.print' />
    <script language="JavaScript">
    <!--
    window.open = SymRealWinOpen;
    //-->
    </script>
    </html:link>
    >
    >
    2 - here is the javascript function : it open a window
    with the "print.jsp" page.
    function openWindowForPrinting(){
    window.open('/your_project/pages/common/print.jsp','',
    'left=150, top=150 , status=no, directories=no,
    toolbar=no, menubar=yes, location=no, scrollbars=yes,
    resizable=yes, dependant=yes');
    3 : here is the print.jsp page : You have only to
    create a session variable called
    "currentBodyRelativeLocation", which content the
    relative URL to the page you want to print (for
    example, the boby of the current page).
    <%@ taglib uri='/WEB-INF/tlds/perso.tld'
    prefix='perso' %>
    <html>
    <head>
    <perso:csslink page='${cssRelativeLocation}' />
    </head>
    <body onload="var SymTmpWinOpen = window.open; window.open = SymWinOpen; printPage();; window.open = SymTmpWinOpen;">
    <body>
    <jsp:include page="${currentBodyRelativeLocation}"/>
    </body>
    <script language="JavaScript">
    <!--
    window.open = SymRealWinOpen;
    //-->
    </script>
    </html>
    <script language='javascript'>
    function printPage(){
    window.print();
    window.close();
    </script>
    hai,
    i'm not very understand how is your code work. when i write html code, do i need to mind about this code: "msg.status.print" ? what is this code mean?
    i have too much question on this thing. would you mind to be further explain to me? or is it any reference for me to refer? i'm really new to write printing function on JSP.
    i never write this function before. i'm feel so lost.....:(
    thanks again
    eric

  • Sendig Emails by using JSP occours an error

    Hi,
    I'm using the following jsp-script:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html><head>
    <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
    <title>JSP</title></head> <body>
    <%@ page import="java.util.*,javax.mail.*,javax.mail.internet.*" %>
    <%
      boolean write=true;
      String missingData="";
      String sep2=".";
      String sep3=":";
      String linesep=System.getProperty("line.separator");
      String name=request.getParameter("nachname");
      String mail=request.getParameter("mail");
      String kommentar=request.getParameter("kommentar");
      if(name.length()==0) {
        out.println("<b>Bitte den Namen eingeben</b><br>");
        write=false;
        missingData=missingData+"Nachname<br>";
      if(mail.length()==0) {
        out.println("<b>Bitte die Mail-Adresse eingeben</b><br>");
        write=false;
        missingData=missingData+"E-Mail<br>";
      if(kommentar.length()==0) {
        out.println("<b>Bitte einen Kommentar eingeben</b><br>");
        write=false;
        missingData=missingData+"Kommentar<br>";
    if(write) {
        GregorianCalendar cal=new GregorianCalendar();
        int day=cal.get(Calendar.DATE);
        int month=cal.get(Calendar.MONTH)+1;
        int year=cal.get(Calendar.YEAR);
        int hour=cal.get(Calendar.HOUR_OF_DAY);
        int minute=cal.get(Calendar.MINUTE);
        int second=cal.get(Calendar.SECOND);
        String body="Ein Internet-Surfer hat das Kontaktformular ausgefllt:"+linesep+linesep;
        body=body+"Name: "+name+linesep+"E-Mail: "+mail;
        body=body+linesep+"Datum: "+day+sep2+month+sep2+year;
        body=body+linesep+"Uhrzeit: "+hour+sep3+minute+sep3+second;
        body=body+linesep+linesep+"Kommentar: "+linesep+kommentar;
        try {
         Properties prop=new Properties();
         prop.put("mail.smtp.host","appmail.eu.infineon.com");
         Session s=Session.getInstance(prop);
         MimeMessage message=new MimeMessage(s);
         InternetAddress from=new InternetAddress(mail);
         message.setFrom(from);
         InternetAddress rcpt=new InternetAddress("[email protected]");
         message.addRecipient(Message.RecipientType.TO,rcpt);
         message.setSubject("Internet-Anfrage");
         message.setText(body);
         Transport.send(message);
         out.println("<p>Vielen Dank fr Ihre Nachricht!</p>");
       catch(MessagingException msgexcep) {
        out.println(msgexcep.getMessage());
    else {
       out.println("<p>Daten konnten nicht abgesendet werden. <br>Folgende Daten fehlen:</p>");
       out.println(missingData);
       out.println("<br><br>");
       out.println("<a href='javascript:history.back()'>Zurck zur Eingabe</a>");
    %>
    </body></html>And the following error occours:
    Sending failed; nested exception is: class javax.mail.MessagingException: 451 4.1.8 To send mail, first check your mail with a valid POP3 account; this prevents unauthorized SPAM relaying. I don't understand this error-message?
    One thing is really stange: this up mentioned script worked very well, yesterday (the emails have been sent without any problems).
    So I haven't changed anything in this script.
    Today I've tried it again and the up mentioned error has been displayed...
    Do you know a reason for it ?
    cu
    Chris

    The normal way to do this is to configure the mail session in the jsp container (I'll explain how to do this in Tomcat in a second).
    I use the following code to obtain the mail session:
        public Session getMailSession() throws EmailProcessingException{
            Session mailSession=null;
            Context initCtx=null;
            try {
                initCtx = new InitialContext();
                if(initCtx == null)
                    throw new EmailProcessingException("No Context");
                Context envCtx = (Context) initCtx.lookup(Constants.CONTEXT);
                mailSession = (Session) envCtx.lookup(Constants.MAILSESSION);
            catch (NamingException e) {
                throw new EmailProcessingException(e);
            return mailSession;    
        }Now, the tricky part is setting up the mail session in JNDI.
    You will need to edit the server.xml file for the tomcat instance that is running, and locate the context element that your JSP is running inside of.
    Here's a full context tag for a sample web app that contains entries for setting the mail authentication:
            <Context className="org.apache.catalina.core.StandardContext" cachingAllowed="true" charsetMapperClass="org.apache.catalina.util.CharsetMapper" cookies="true" crossContext="false" debug="0" displayName="WWW" docBase="C:\Program Files\eclipse data\workspace\www" mapperClass="org.apache.catalina.core.StandardContextMapper" path="/www" privileged="false" reloadable="true" swallowOutput="false" useNaming="true" wrapperClass="org.apache.catalina.core.StandardWrapper">
              <Resource name="mailSession/YourApp" scope="Shareable" type="javax.mail.Session"/>
              <ResourceParams name="mailSession/YourApp">
                <parameter>
                  <name>mail.smtp.host</name>
                  <value>mail.yourhost.com</value>
                </parameter>
                <parameter>
                  <name>mail.smtp.password</name>
                  <value>your smtp password here</value>
                </parameter>
                <parameter>
                  <name>mail.smtp.user</name>
                  <value>your smtp username here</value>
                </parameter>
             <parameter>
               <name>mail.smtp.auth</name>
               <value>true</value>
             </parameter>
              </ResourceParams>
            </Context>Hope this helps - it took awhile for me to find the correct parameter names (documentation was a bit sketchy on this).
    One big advantage of doing it this was (using JNDI) is that you don't have to hard code your passwords, etc... into your source code. You can even use different mail servers on your development workstation than in production.
    Cheers,
    - K

  • How to create Incoming Email Activity using BAPI or Function module

    To create an Incoming Email Activity using BAPI 'BAPI_ACTIVITYCRM_CREATEMULTI' or using 'CRM_ORDER_MAINTAIN' . what parameters i need to pass to a bapi.
    Suggest me with a solution.
    Regards,
    Sanjani

    For activity you must fill the following structures of 'CRM_ORDER_MAINTAIN'...
      CALL FUNCTION 'CRM_ORDER_MAINTAIN'
        EXPORTING
          it_activity_h             = t_activity_h
          iv_collect_exceptions = ''
        CHANGING
          ct_orderadm_h         = t_orderadm_h
          ct_input_fields       = t_input_fields
        EXCEPTIONS
          error_occurred        = 1
          document_locked       = 2
          no_change_allowed     = 3
          no_authority          = 4
          OTHERS                = 5.
    And at the end you must use also 'CRM_ORDER_SAVE' to performe the save.
    Regards.

  • How to use email function in crystal report ?

    Post Author: kudo
    CA Forum: .NET
    Hi I'm a novice by touching .net not more than 2 months. Can somebody guide me how to use email function provided in crystal report components?(Better put a sample code so that I can understand well.)  ps: I'm using VS2005 VB.net.Thanks.

    Post Author: mewdied
    CA Forum: .NET
    'EXPORT to EMAIL        ''' Code for exporting the report to Mapi (.Net Windows application)        ''' *For a Web application you must export to disk as a PDF file first.
            crReportDocument.Load(Application.StartupPath + "\World Sales Report.rpt")        crMicrosoftMailDestinationOptions = New MicrosoftMailDestinationOptions        With crMicrosoftMailDestinationOptions            .MailCCList = "[email protected]"            .MailToList = "[email protected]"            .MailSubject = "Attached exported report"            .UserName = "admin"            .Password = "password"        End With
            crExportOptions = crReportDocument.ExportOptions        With crExportOptions            .DestinationOptions = crMicrosoftMailDestinationOptions            .ExportDestinationType = ExportDestinationType.MicrosoftMail            .ExportFormatType = ExportFormatType.PortableDocFormat        End With
            'Add some error handling        Try            crReportDocument.Export()            MsgBox("Report exported successfully.")        Catch err As Exception            MessageBox.Show(err.ToString())        End Try
    Hope this helps

  • Using JSP include function

    Using JSP include function + collapse/expand table
    (1) I've got a page A (A.jsp) and a page B (B.jsp) which includes 3 files : the header (head.html) and the side panel of icons (icons.jsp) are the same files for both A.jsp and B.jsp
    but the 3rd file containing the contents, are different for A and B
    (2) icons.jsp
    This is what the side panel of icons is suppose to do. E.g. click on icon1, its submenu will appear and the 3rd file is suppose to link to e.g. A.jsp
    When click on icon2, icon1's submenu will collapse and icon2's submenu will expand and the 3rd file is suppose to link to B.jsp
    The expand/collapse function is written in javascript
    (3) Problem : e.g. when i click on icon1, its submenu wont remain expanded, when it changes to another page, icon1's submenu will collapse back, even though the other page includes the icons.jsp too.
    Hence, i've decided to pass a parameter using JSP to achieve the desired effect. as a result, i include the icons file like this
    <%@ include file="icons.jsp?item=icon1" %>, but the icons.jsp file isnt included into the page at all.
    Is the above include file method possible? And is it possible to use JSP to achieve the effect i've stated?
    Thanx

    sounds more like a html problem.
    Do you have a target with the <a href> of your icons? Sounds like the icon page is being refreshed as well.
    <html>
    <frameset .....>
    <frame src=header.jsp name=head>
    <frameset name=bottom>
    <frame src=icons.jsp name=navigate>
    <frame src=dummy.jsp name=content>
    </frameset>
    </frameset>
    try <img src=niceIcon1.gif>

  • Using JSP parameters as input in a JavaScript function

    hey
    I have a JavaScript function, which I call with JSP parameters.
    The function call looks similar to:
    <button onclick="myFunction(<%= jspParameter%>);"> </button>
    However, this JavaScript function is called from a jsp page, which is asynchronously refreshed upon a click of the button.
    The problem is that the JavaScript function does NOT function when I click the button for the first time (or maybe it functions, but with the old value of the jspParameter).
    Only after the second click it starts taking the jspParameter.
    Can you please tell me how to properly get the jspParameter as input in my case....
    thank you

    I'm sorry, you're right - I didn't give enough details.
    My whole page consists of several jsp-s.
    The jsp, from which I call the JavaScript function is just one part of the whole page. I'll call it partToBeChanged.jsp.
    When I press the button, the partToBeChanged.jsp should refresh asynchronously and call the JavaScript function using the new jsp parameter as input.
    To be more precise, here is roughly how myFunction looks like (JavaScript):
    function myFunction(url, jspParam) {
         var XMLHttpRequestObject = false;
         if (window.XMLHttpRequest) {
              XMLHttpRequestObject = new XMLHttpRequest();
         } else if (window.ActiveXObject) {
              XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP");
         if (XMLHttpRequestObject) {
              XMLHttpRequestObject.open("GET", myServlet + url, true);
              XMLHttpRequestObject.onreadystatechange = function() {
                   if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) {
                        //plug server response in the target place.
                        //The target is an id of a division, which holds the partToBeChanged.jsp page
                        //The server itself uses RequestDispatcher to direct the response to the partToBeChanged.jsp     
                        //NOTE: partToBeChanged is only a part of the whole HTML page, which is refreshed dynamically               
                        document.getElementById('target').innerHTML = XMLHttpRequestObject.responseText;
                        //changes the content of a div, which is IN ANOTHER .jsp fragment (different than partToBeChanged.jsp)
                        y = document.getElementById("div_to_change");
                        y.innerHTML = jspParam;
              XMLHttpRequestObject.send("");
    }the jspParam is a java object, initialized in the servlet and used in partToBeChanged.jsp
    To summarize: the servlet dispatches the response to the partToBeChanged.jsp page, which uses the jspParam as input for myFunction, and myFunction tries to change the content of the "target" div accorting to the jspParam. However it changes as expected only after the second button click.
    Thanks a lot for any help....

  • How to code the function of  add+delete+edit using jsp??

    how to code the function of add+delete+edit using jsp??i'm also using the ms sql server 2000 as a database. pls help me!!

    Hi,
    I think you will find the following useful.
    Performing Inserts, Updates, and Deletes
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/inserts_updates_deletes.html

  • Why cant I send emails, or open folders, from my Outlook email when using ipad. My Outlook is functioning normally when accessed from laptop.

    Why am I unable to send emails or open folders from my Outlook email when using my iPad?  My Outlook is functioning normally when accessed from my laptop.  This problem has been going on for three days now - everything was functioning normally before. I have looked at the standard troubleshooting suggestions provided by Apple, but they do not appear to cover this eventuality.  I should be most grateful for any help.

    Try first to Clear your cache from : Tools > Options > Advanced > Network, Clear Now button.
    if the above is not helpful, [https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles create a new profile] and check it again.
    if you create the new profile see: [https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles#w_recovering-information-from-an-old-profile Recovering information from an old profile]
    thank you

  • How to send emails using JSP?

    How can i send emails using JSP? what are the things that i will need? please help me asap...thanks

    Hi,
    This works for me:
    <%
    String from = "Person"
    String to= "my-email-address;
    try{
    SmtpClient client = new SmtpClient("smtp.stuff.com");
    client.from(from);
    client.to(to);
    PrintStream message = client.startMessage();
    message.println("To: " + to);
    message.println("Subject: Sending an e-mail");
    message.println();
    message.println("Groovy :-)");
    client.closeServer();
    catch (IOException e){
    System.out.println("ERROR SENDING EMAIL: "+e);
    %>

  • How can I generate auto Emails upon successful registration using jsp?

    Dear all, I have been researching on how to send auto-emails using JSP for several days but I still do not understand how to do it and how it works! I tried reading JavaMail but i do not understand it can anyone help me?
    Thank You very Much,

    The mail.jar & activation.jar are part of Tomcat 4.x and up
    Here is my simple example, you may want to make bean methods to get/properties so that you create an email like an object :-o
    Notice, I make the message body a StringBuffer, so you can append info as you see fit.
    Also assuming your SMTP server is the local machine, set that property to "localhost".
    I also use a boolean return so I know if the message sent otherwise display a message to the user (aka, please email support to confirm your registration, etc.)
    import java.util.Date;
    import java.util.Properties;
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.net.InetAddress;
        private String to = "[email protected]";
        static private String from = "registered@localhost";
        private String subject = "Registered";
        private StringBuffer messageText = null;
        private Properties props = null;
        private Session sess = null;
        private InternetAddress toAddr = null;
        private InternetAddress fromAddr = null;
        public Email() {
            try{
                props = new Properties();
                props.put("mail.smtp.host","localhost");
                Session sess = Session.getDefaultInstance(props,null);
                this.toAddr = new InternetAddress(to);
                this.fromAddr = new InternetAddress(from);
                this.messageText = new StringBuffer(new Date() + "\n\n");
            } catch (Exception e) {
                e.printStackTrace();
        public boolean sendMessage(){
         try{
                // Create the message object
                Message message = new MimeMessage(sess);
                message.setFrom(fromAddr);
                message.setRecipient(Message.RecipientType.TO, toAddr);
                message.setSubject(subject);
                message.setContent(messageText.toString(),"text/plain");
                // Send Message
                Transport.send(message);
                return true;
         }catch (Exception e){
                e.printStackTrace();
                return false;
        }

  • Email function [jsp/java]

    i am doing a email function, but i don't know how to do the upload attached file function.
    how to do this task.
    and if i want to build a email function, which method will better performance and simple to build?
    example code for my reference.?
    help~ help

    [Apache Commons FileUpload|http://commons.apache.org/fileupload/]
    The JavaMail FAQ has pointers to all sorts of example JavaMail code.

  • How to get the values of an Array using JSP Tags

    Hey guys,
    I need some help. I've splited a String using
    fn:split(String, delim) where String = "1,2,3,4" and delim is ,
    This method returns an Array of splited Strings. how do i get the values from this array using jsp tags. I don't wanna put java code to achive that.
    Any help would be highly appreciated
    Thanks

    The JSTL forEach tag.
    In fact if all you want to do is iterate over the comma separated list, the forEach tag supports that without having to use the split function.
    <c:set var="list" value="1,2,3,4"/>
    <c:forEach var="num" items="${list}">
      <c:out value="${num}"/>
    </c:forEach>The c:forTokens method will let you do this with delimiters other than a comma, but the forEach tag works well just with the comma-delimited string.

  • How can I send email from a JSP page?

    my web site is created using jsp. how can i send my page to e-mail and inside e-mail, i will receive exactly same as my web site. i dont want it look like plain text. i can send my page to e-mail but it look plain because all the color and tables was lost. how can i solve these problem?

    Look in the JavaMail forum on how to create Mime format emails. This allows you to use HTML instead of plain text.
    Anthony

Maybe you are looking for

  • 'Out of frequency'

    Hello I installed Solaris 10 succesfully on my x86 desktop, but I didn't realised in time that I was working with a LCD screen, so I entered the option about the standaard 75Hz frequency away... Now if I start up Solaris, I first get the bootscreen w

  • How can I get itunes buttons to work?

    None of the iTunes buttons work, such as "Music," "Albums," "iTunes Store." So, I can't access any of my music. Any suggestions would be appreciated.

  • PHP odbc_connect on a running SQL Anywhere 16 server

    Hello, please help with the following php odbc_connect problem: On my local machine (win 7, 64 bits) is a running SQL Anywhere 16 database. Started with dbeng16.exe -c 8m -n xx_test "G:\DEMOS\xx\DB16\test.db" In the ODBC manager then created a ODBC c

  • Why is Safari blocking the latest Java plugin?

    Today, I fired up Safari to access my work server but the required Java applet wouldn't run. Safari displayed "Blocked Plugin" and clicking it said my Java was out of date and/or a security risk. I upgraded to the most recent Java (7.10, I believe) a

  • Itunes won't open...says I don't have Quicktime. Does open at work though.

    When at home, I try to open itunes and it gives me the following error ""Quicktime is required to run itunes. Please uninstall itunes then install itunes again." And it won't open. However, I take my same computer to my office, and itunes opens fine.