• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Problem sending mail using JSTL

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to send e-mail using JSTL. I have "taglibs-mailer.jar" (Version 1.1) in webapps/myApp/WEB-INF/lib. I also have "activation.jar" and "mail.jar" in C:\j2sdk1.4.2_03\lib and they are in classpath.
In my JSP I have following lines of code:
taglib uri="http://jakarta.apache.org/taglibs/mailer-1.1" prefix="mt"
c:if test="${pageContext.request.method=='POST'}"
c:set var= "email" value= " '${param.e_mail}' "
mt:mail server="myServer" to="${email}" from="eMailAddress" subject="Test mail"

mt:message>This is a test </mt:message
mt:send/
/mt:mail

The JSP itself doesn't show any error but the mail doesn't get delivered. I get an "Undeliverable mail" message from the server.
It says:
The following recipient(s) could not be reached:
${email}@myServer

How can I set a variable to the e-mail address and use that variable for sending the e-mail?
Thanks in advance.
Arun
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm. It looks to me as if you may be using the wrong "flavor" of JSTL.
JSTL comes in two types: one which expands ${expr} expressions in attribute text, and one which expands <%=expr%> expressions. You don't tell us which one you are using, so It might be worth trying the other form and see what happens.
 
Arun Bommannavar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Frank,
I didn't know about the two flavors of JSTL.
I downloaded the "jakarta-taglibs-standard-1.1.0-B1.zip " from "http://apache.webmeta.com/jakarta/taglibs/standard/binaries/" site. After unzipping I get two files "jstl.jar" and "standard.jar". How do I find out which type is supported in this distribution?
Perhaps I am completely off track. Should I instead download "Java Web Services Developer Pack 1.3 " from Sun site? As I see from the description that this contains quite a few components and wasn't sure I need all that.
Thanks in advance.
Regards
Arun
 
reply
    Bookmark Topic Watch Topic
  • New Topic