Sending an email through JSP and WML

I am trying to send an email through jsp in wml, i think i have everything set up properly with regards to tomcat however I keep getting the error
"Invalid element 'PCDATA' in context of card expected on event ....."
The line of code in which this occurs is           
<jsp:setProperty name="mailer" property="*"/>
I was wondering if anyone would be able to help me with this and be able to tell me why it thinks this is PCDATA and not jsp code.
Any help would be much appreciated.

Check out:
http://jakarta.apache.org/taglibs/index.html

Similar Messages

  • Sending an email through jsp

    is there any facility to send an email to persons through jsp

    Check out:
    http://jakarta.apache.org/taglibs/index.html

  • How do i authentication so that i can send a email through jsp a page

    <%@ page import="java.lang.*,java.util.*,javax.mail.*,javax.mail.internet.*,
    javax.activation.*" %>
    <%
    String p_to = "[email protected]"; // Please fill in your email here
    String p_from = "[email protected]"; // Please fill in receipient’s email here
    String p_subject = "Testing";
    String p_message = "This is a test email";
    String l_host = "smtp.mail.yahoo.com.sg";
    // Gets the System properties
    Properties l_props = new Properties();
    // Puts the SMTP server name to properties object
    l_props.put("mail.smtp.host", l_host);
    l_props.put("mail.smtp.port","25");
    l_props.put("mail.transport.protocol","smtp");
    l_props.put("mail.smtp.auth", "true");
    l_props.put("mail.user", "ancde");
    l_props.put("mail.password","password");
    // Get the default Session using Properties Object
    Session l_session = Session.getInstance(l_props, null);
    l_session.setDebug(false); // Enable the debug mode
    try {
    MimeMessage l_msg = new MimeMessage(l_session); // Create a New message
    l_msg.setFrom(new InternetAddress(p_from)); // Set the From address
    l_msg.setRecipients( Message.RecipientType.TO
    , InternetAddress.parse(p_to, false));
    l_msg.setSubject(p_subject); // Sets the Subject
    // Create and fill the first message part
    MimeBodyPart l_mbp = new MimeBodyPart();
    l_mbp.setText(p_message);
    // Create the Multipart and its parts to it
    Multipart l_mp = new MimeMultipart();
    l_mp.addBodyPart(l_mbp);
    // Add the Multipart to the message
    l_msg.setContent(l_mp);
    // Set the Date: header
    l_msg.setSentDate(new Date());
    // Send the message
    Transport.send(l_msg);
    // If program reaches this point, then message is successfully sent.
    out.print("Success");
    } catch (MessagingException mex) { // Trap the MessagingException Error
    out.print("Failure: Messaging Exception: " + mex);
    } catch (Exception e) {
    out.print("Failure: General Exception: " + e);
    e.printStackTrace();
    %>

    First, I would strip out all of that code and put it in a servlet.
    Second, this has nothing to do with Web Start or JNLP.

  • Sending an email with JSP

    Hi
    I am trying to send an email through JavaMail, the jsp page which is sending the mail is called testmail.jsp. Code snippet:
    try
    InternetAddress toAddress = new (InternetAddress"xxxxxxxx","xxx");
    InternetAddress fromAddress = new InternetAddress("xxxxxxx","xxxxxx");
    Properties props = new Properties();
    props.put("mail.smtp.host", "xxxxxxxx");
    Session mailsession = Session.getDefaultInstance(props, null);
    Message msg = new MimeMessage(mailsession);
    msg.addRecipient(Message.RecipientType.TO, toAddress);
    msg.setSubject("A Simple E-mail Message!");
    msg.setFrom(fromAddress);
    msg.setText("Hi\rThis message has been sent from a JSP page.\nBye\rTest");
    Transport.send(msg);
    %>
    <b>An e-mail has been sent.</b>
    <%
    catch (Exception e)
    e.printStackTrace();
    When i send the email to my own email address(on the same domain where the actual testmail.jsp is hosted) my mail is being sent successfully. BUT when i try sending to eg. a hotmail address I just get a blank page with no errors (from Tomcat) and no mail is sent.
    PLEASE HELP. Is it something to do with the protocol or am I doing something wrong
    THANKS LODES
    sabcarina

    Hi gimbal2
    i changed the catch block code. This is the exception im getting now :
    javax.mail.SendFailedException: Invalid Addresses; nested exception is: class com.sun.mail.smtp.SMTPAddressFailedException: 503 This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or contact your administrator to verify that the domain or address is defined for this server. at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1130) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:525) at javax.mail.Transport.send0(Transport.java:151) at javax.mail.Transport.send(Transport.java:80) at org.apache.jsp.testmail_jsp._jspService(testmail_jsp.java:73) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:184) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:339) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:415) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:716) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:650) at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:829) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:688) at java.lang.Thread.run(Thread.java:534)

  • Sending an email through JavaMail

    Hi
    I am trying to send an email through JavaMail, the jsp page which is sending the mail is called testmail.jsp. Code snippet:
    try
    InternetAddress toAddress = new (InternetAddress"xxxxxxxx","xxx");
    InternetAddress fromAddress = new InternetAddress("xxxxxxx","xxxxxx");
    Properties props = new Properties();
    props.put("mail.smtp.host", "xxxxxxxx");
    Session mailsession = Session.getDefaultInstance(props, null);
    Message msg = new MimeMessage(mailsession);
    msg.addRecipient(Message.RecipientType.TO, toAddress);
    msg.setSubject("A Simple E-mail Message!");
    msg.setFrom(fromAddress);
    msg.setText("Hi\rThis message has been sent from a JSP page.\nBye\rTest");
    Transport.send(msg);
    %>
    <b>An e-mail has been sent.</b>
    <%
    catch (Exception e)
    e.printStackTrace();
    When i send the email to my own email address(on the same domain where the actual testmail.jsp is hosted) my mail is being sent successfully. BUT when i try sending to eg. a hotmail address I just get a blank page with no errors (from Tomcat) and no mail is sent.
    PLEASE HELP. Is it something to do with the protocol or am I doing something wrong
    THANKS LODES
    sabcarina

    Basically, it's fine. The only thing I could see (other than adding imports, etc.) was that there was an extra open parenthesis in the first InternetAddress declaration. This is my complete JSP, which worked fine for me:<%@ page import="javax.mail.*" %>
    <%@ page import="javax.mail.internet.*" %>
    <%@ page import="java.util.*" %>
    <%
    try {
       InternetAddress toAddress = new InternetAddress("[email protected]","Bill Gates");
       InternetAddress fromAddress = new InternetAddress("[email protected]","Hotmail");
       Properties props = new Properties();
       props.put("mail.smtp.host", "smtp.server.address");
       Session mailsession = Session.getDefaultInstance(props, null);
       Message msg = new MimeMessage(mailsession);
       msg.addRecipient(Message.RecipientType.TO, toAddress);
       msg.setSubject("A Simple E-mail Message!");
       msg.setFrom(fromAddress);
       msg.setText("Hi\rThis message has been sent from a JSP page.\nBye\rTest");
       Transport.send(msg);
       %>
          <b>An e-mail has been sent.</b>
       <%
    } catch (Exception e) {
       e.printStackTrace();
    %>Bob

  • Can LabVIEW send an email through Microsoft Exchange server without an account set up in Outlook?

    I've found sample code that shows how to send email through Outlook using LabVIEW.  On any computer I log into on our network, my profile loads and I have access to the exchange server through Outlook so the code works.
    However, I am developing a program that will run on a lab computer with a generic PC login that is shared among everyone in the lab.  Exchange server/outlook is not set up for the generic user.
    Is it possible to have labVIEW send an email through the exchange server with a server name, username, and password coded into the executable?

    You would need to send a standard SMTP message via Exchange. The Exchange server will likely require authentication, so you won't be able to use the built-in SMTP VIs, as they do not support authentication. If you're on Windows you can use .NET (see this example), or use the OpenG SMTP VIs.

  • Why I can't  send my email through my Ipad 3?

    I don't know what to do. everytime I send my email through my ipad 3 , It said because of outsider server but I think it is not correct . cos my friend can send it but me not so what shoud i do?

    Sann Raksmey wrote:
    why when I connect my Ipad3 to my Window Computer it does not charge? I mean my ipad not charge like when I connect it with other App Computer at Apple Store?
    The quickest way (and really the only way) to charge your iPad is with the included 10W USB Power Adapter. iPad will also charge, although more slowly, when attached to a computer with a high-power USB port (many recent Mac computers) or with an iPhone Power Adapter (5W). When attached to a computer via a standard USB port (most PCs or older Mac computers) iPad will charge very slowly (but iPad indicates not charging). Make sure your computer is on while charging iPad via USB. If iPad is connected to a computer that’s turned off or is in sleep or standby mode, the iPad battery will continue to drain.
    Apple recommends that once a month you let the iPad fully discharge & then recharge to 100%.
    How to Calibrate Your Mac, iPhone, or iPad Battery
    http://www.macblend.com/how-to-calibrate-your-mac-iphone-or-ipad-battery/
    At this link http://www.tomshardware.com/reviews/galaxy-tab-android-tablet,3014-11.html , tests show that the iPad 2 battery (25 watt-hours) will charge to 90% in 3 hours 1 minute. It will charge to 100% in 4 hours 2 minutes. The new iPad has a larger capacity battery (42 watt-hours), so using the 10W charger will obviously take longer. If you are using your iPad while charging, it will take even longer. It's best to turn your new iPad OFF and charge over night. Also look at The iPad's charging challenge explained http://www.macworld.com/article/1150356/ipadcharging.html
    Also, if you have a 3rd generation iPad, look at
    Apple: iPad Battery Nothing to Get Charged Up About
    http://allthingsd.com/20120327/apple-ipad-battery-nothing-to-get-charged-up-abou t/
    Apple Explains New iPad's Continued Charging Beyond 100% Battery Level
    http://www.macrumors.com/2012/03/27/apple-explains-new-ipads-continued-charging- beyond-100-battery-level/
    New iPad Takes Much Longer to Charge Than iPad 2
    http://www.iphonehacks.com/2012/03/new-ipad-takes-much-longer-to-charge-than-ipa d-2.html
    Apple Batteries - iPad http://www.apple.com/batteries/ipad.html
    Extend iPad Battery Life (Look at pjl123 comment)
    https://discussions.apple.com/thread/3921324?tstart=30
    New iPad Slow to Recharge, Barely Charges During Use
    http://www.pcworld.com/article/252326/new_ipad_slow_to_recharge_barely_charges_d uring_use.html
    Tips About Charging for New iPad 3
    http://goodscool-electronics.blogspot.com/2012/04/tips-about-charging-for-new-ip ad-3.html
    Prolong battery lifespan for iPad / iPad 2 / iPad 3: charging tips
    http://thehowto.wikidot.com/prolong-battery-lifespan-for-ipad
    In rare instances when using the Camera Connection Kit, you may notice that iPad does not charge after using the Camera Connection Kit. Disconnecting and reconnecting the iPad from the charger will resolve this issue.
     Cheers, Tom

  • Can we send bulk email through exchange server 2010

    can we send bulk email through exchange server 2010

    You can do this however not sure I would recommend that since if people complain they are getting spammed it could effect your production servers domain/IP, i.e. it could get black listed.   Personally I always recommend using a different system for
    email blast  to protect my production IP addresses and also to keep the load off of exchange as well as email marketing systems have built in capabilities for reporting, opt in/out capabilities etc.
    All of that said perhaps you can tell us more about what exactly it is you want to do and how often?
    Search, Recover, & Extract Mailboxes, Folders, & Email Items from Offline Exchange Mailbox and Public Folder EDB's and Live Exchange Servers or Import/Migrate direct from Offline EDB to Any Production Exchange Server, even cross version i.e. 2003 -->
    2007 --> 2010 --> 2013 with Lucid8's
    DigiScope

  • Using launchd to send an email on startup and shutdown

    Hello All !
    I'd like to get an email whenever my Mac starts up and shuts down, since I have to leave it unattended for quite some long periods of time (and even with the help of a UPS, power goes out anyway...). My Mac runs under Mac OS X Lion.
    I found some help on the Internet, mainly from this page : http://www.syntaxtechnology.com/2009/06/email-on-shutdown-and-restart/ , which applies to Linux, and hoped it could work on Mac OS X (I thought at first I could just drop a script in something like /etc/init.d/ or /etc/rc.d/rc5.d but well... we have launchd instead...).
    The first method listed in the page above worked well, but sends an email only on startup (for a reminder: you add a line that starts with @reboot in your crontab, and a command that sends directly an email).
    I then tried to adapt the second method to Mac OS X, and succeeded partially: I wrote a small script based on what was shown on that page (a start and stop function, start gets called when the script is started, and stop gets called based on a trap on various kill signals, with an infinite wait loop: see below). I also wrote the plist file, loaded it in launchd and rebooted my Mac several times to test everything.
    I get an email on each startup (yeah!), but the shutdown mail gets sent only at the next startup. So I guess that postfix gets killed by the shutdown process *before* being able to send my shutdown email :-(
    So here are my main questions, if someone can help me:
    1. is there a way to precisely call a script during the shutdown process, meaning giving it a priority so it gets called before postfix dies ? (like the rc directories and the naming conventions (KnnScriptName and SnnScriptName) found on some Linux/Unix).
    2. is it possible to do that with launchd ? if not, what would be the Mac OS X sanctionned way of doing this ?
    Other things:
    3. my shell script writing ability is kind of rusty, so maybe I made some "very bad shell writingTM": l'm not sure putting an infinite while loop with a 15 second pause in it is the best way of telling a script to do nothing. There might other things in there that would make an Unix guru jump out of his chair: please tell me :-)
    This is my plist:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC “-//Apple Computer//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”>
    <plist version=“1.0”>
    <dict>
    <key>Disabled</key>
    <false/>
    <key>Label</key><string>org.amarante.startshutemail</string>
    <key>ProgramArguments</key>
    <array>
    <string>/Library/Scripts/startshutemail-launchd.sh</string>
    <string>start</string>
    </array>
    <key>RunAtLoad</key><true/>
    </dict>
    </plist>
    And this is the script that does the job:
    #!/bin/bash
    # PHL 20120604 startshutemail-launchd.sh
    # Send an email on startup and shutdown (version for launchd)
    # Based on script and explanations found here:
    # http://www.syntaxtechnology.com/2009/06/email-on-shutdown-and-restart/
    # Modification history
    # PHL 20120604 v01 First version
    # Environment variables #################################################
    DEST_EMAIL="[email protected]"
    SRV_NAME=Amarante
    EVENT_TIME=$(date +%Y/%m/%d-%H:%M:%S)
    RESTART_SUBJECT="[$SRV_NAME] $EVENT_TIME : System Startup"
    RESTART_BODY="This is an automated message to notify you that $SRV_NAME started successfully at $EVENT_TIME."
    SHUTDOWN_SUBJECT="[$SRV_NAME] $EVENT_TIME : System Shutdown"
    SHUTDOWN_BODY="This is an automated message to notify you that $SRV_NAME is shutting down now ($EVENT_TIME)."
    # Functions ##########
    stop()
    echo "$SHUTDOWN_BODY" | mail -s "$SHUTDOWN_SUBJECT" $DEST_EMAIL
    return 0
    start()
    echo "$RESTART_BODY" | mail -s "$RESTART_SUBJECT" $DEST_EMAIL
    return 0
    # Main part #########
    case $1 in
    stop)
    stop
    start)
    start
    esac
    # trap kill signals to send an email
    trap stop HUP INT QUIT ABRT KILL ALRM TERM TSTP
    # sleep until killed
    while :
      do
        sleep 15
      done
    Thanks for your help, and any comment :-)
    Paul-Henri

    Thanks a lot for your answer, Camelot, even if it sorts of confirm what I suspected. Pinging a machine from an external observer is a solution, but it will also report broken links problems and not only a computer shutting down, and it raises the next tier of problems, general network reliability after individual system reliability. It's something I'll have to look at for sure.
    It's weird there isn't any way to access the way the shutdown process works.
    One of the commenters (#14) on the page from Syntaxtechnology had a similar problem: he added a "sendmail -q" in his script to force sendmail to go to work and service the queue before shutting down, which I can try, but he also added a delay to the stop process of sendmail, which is something I'm not sure I can do on Mac OS X (and that might disappear one day with one of the OS updates).
    Unless there is a way to change the launchd.plist file for postfix and add an ExitTimeOut option in it (I found this idea here : https://discussions.apple.com/message/17229690#17229690 )
    Cheers,
    Paul-Henri

  • PDF is changing all my pdf documents into a word document - My boss sent me a pdf email through outlook and when I try to open it changes to a word document

    PDF is changing all my pdf documents into a word document - My boss sent me a pdf email through outlook and when I try to open it changes to a word document Help this is so frustrating

    Hi tinam74565130,
    That does sound frustrating! It sounds as though the filename associations have become confused on your computer. You should be able to reset that easily. Here are some instructions:
    Change which programs Windows uses by default - Windows Help
    How to change the default application for a file type | Macworld
    Please let us know how it goes.
    Best,
    Sara

  • How to send an email in jsp

    hei evryone!
    can anyone pls help me on how to send an email in jsp. I mean i have a webpage wherein you submit data , upon submission or after the submit button is clicked i need to send an email to a person regarding the data sumitted on the form , i dunno how to do this, can anyone please help me on how to use Javamail, or can anyone post a sample code or site of a tutorial .. thx!

    There are some quite good examples on the use of Javamail on the Sun website. No, we're not going to write your application for you, unless you're willing to pay consultancy fees in real money.
    http://java.sun.com/products/javamail/index.jsp
    http://java.sun.com/products/javamail/FAQ.html
    http://java.sun.com/products/javamail/reference/techart/index.html

  • I am trying to send an email to myself and BCC everyone in my address, but have forgotten how. Can someone help me with this?

    I am trying to send an email to myself and bcc everyone in my address book, but have forgotten how. Can anyone help me with this? Thanks.

    http://chrisramsden.vfast.co.uk/7_How_do_I_send_to_everyone.html

  • Can't attach some files when sending an email through Safari (via Gmail)

    I'm trying to send an email to myself, and I can't seem to attach files that were created using iWork programs (Pages, Numbers etc.) How can I get Safari/Gmail to allow me to email these files?

    I can't seem to attach files that were created using iWork programs (Pages, Numbers etc.)
    These are not files; they are folders that appear as files to the user. To email them to anyone you must create an archive (.zip file) of them and email that archive to the recipient.
    Mulder

  • How do i send an email to addressee and receive back a confirmation that the addressee received my email?

    how do i send an email to addressee and receive back a confirmation that the addressee received my email?

    Even if you find a way to send the request for a read confirmation with the email, you are dependent on the recipient's mail system and/or mail reading software to notice it and comply with it. Many do not do so, either because they cannot or because somebody has disabled (or not enabled) the feature.

  • When I send an email with attachments and open them on my ipad some of them open but others do not

    When I send an email with attachments and open them on my ipad some of them open but others do not

    What are the types that won't open?
    Do you have an App that can open those types of files?

Maybe you are looking for

  • Two different page numbers in the same line in my Table of Contents

    Hi, I'm having trouble finding a solution to this problem. My table of contents entries are showing two numbers instead of one. I don't understand how this happened. The entries should look like this: These are my Table of Contents settings: I've bee

  • Reading text file in jsp

    hi, i have a txt file...which i am reading in my jsp page using bufferedreader class, to read txt file i have to type the absolute path of txt file as c:/myproject/xxx.txt how can i access this txt file with relative path as xxx.txt instead of typing

  • Touch screen 520

    I am very upset ... .... My HP Touchscreen 520-1032 is not working well. Smart Center is not working. When I clicked in, it said - a problem cause the program to stop working correctly. Anyone can help, plsssssssssssss

  • Question on SQL_TEXT from v$sqlarea

    Windows 2003 Oracle 9.2.0.6.0 I have a number of DML statements I want to run dynamically. I have a PLSQL proc which generates the statements and populates a tracking table with them. It then selects from the tracking table and executes each statemen

  • StringIndexOutOfBoundException In UDF in mapping

    Hi , I have a UDF via which I am taking the input string and for every 132 characters of input string I split in show it in a different line of an idoc. It is working fine for 2 lines .However when I get 3 lines  i.e. anything more then 395 character