| Author |
Problem sending mail using JSTL
|
Arun Bommannavar
Ranch Hand
Joined: Jan 11, 2003
Posts: 53
|
|
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
|
 |
Frank Carver
Sheriff
Joined: Jan 07, 1999
Posts: 6915
|
|
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.
|
A Convergent Visionary ~ Frank's Punchbarrel Blog ~ LinkedIn profile
|
 |
Arun Bommannavar
Ranch Hand
Joined: Jan 11, 2003
Posts: 53
|
|
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
|
 |
 |
|
|
subject: Problem sending mail using JSTL
|
|
|