You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Darcee Thomason <da...@involved.com> on 2003/02/28 20:05:46 UTC

mail help

I am new to this JSP taglib thing.  Could someone please tell me why this 
does not work?  Thank you.

-D

<%@ taglib uri="http://jakarta.apache.org/taglibs/mailer-1.1" prefix="mt" %>

<html>
<head>
</head>
<body>
<%String body = request.getParameter("body");
String to = request.getParameter("to");
String from = request.getParameter("from");
String subject = request.getParameter("subject");
%>

<mt:mail  to="<%= to %>"
from="<%= from %>"  subject="<%= subject %>" >
     <mt:message>"<%= body %>" </mt:message>
     <mt:send/>
</mt:mail>

</body>
</html>

RE: mail help

Posted by Jerome Jacobsen <je...@gentootech.com>.
What a pain.  Darcee if you're running in a JSP 2.0 container (e.g. Tomcat
5.0) then I think you should be able to do this:

<mt:mail to='${param["to"]}' from='${param["from"]}'
subject='${param["subject"]}'>
     <mt:message>${param["body"]}</mt:message>
     <mt:send/>
</mt:mail>

I haven't used a JSP 2.0 container before, but I think this is correct.

> -----Original Message-----
> From: Dave Newton [mailto:dave@solaraccess.com]
> Sent: Friday, February 28, 2003 2:32 PM
> To: Tag Libraries Users List
> Subject: Re: mail help
>
>
> > The code works when I replace the variables with static info.
>
> Oopos, my bad, didn't even see that.
>
> See
> http://jakarta.apache.org/taglibs/doc/mailer-doc/mailer-1.1/index.
> html#reference
>
> and notice that none of those attributes take rtexprs. That'd be my
> guess. Also, I'm not sure if you  meant to quote the message body or
> not.
>
> > <mt:message>"<%= body %>" </mt:message>
>
> Dave
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: mail help

Posted by Dave Newton <da...@solaraccess.com>.
> The code works when I replace the variables with static info.

Oopos, my bad, didn't even see that.

See   
http://jakarta.apache.org/taglibs/doc/mailer-doc/mailer-1.1/index.html#reference

and notice that none of those attributes take rtexprs. That'd be my
guess. Also, I'm not sure if you  meant to quote the message body or
not.

> <mt:message>"<%= body %>" </mt:message>

Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: mail help

Posted by Darcee Thomason <da...@involved.com>.
Yes there is a mail server.
The code works when I replace the variables with static info.  I do not 
receive any error, but I don't receive an email either.

-D

At 02:19 PM 2/28/2003 -0500, you wrote:
>On Fri, 2003-02-28 at 14:05, Darcee Thomason wrote:
> > Could someone please tell me why this does not work?
>
>Doubtful from what little you've given us.
>
>Are you running a mailserver? Did you check the mailserver logs? Did you
>check the servlet container logs to see if there are any messages there?
>Are any exceptions thrown?
>
>Dave
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: mail help

Posted by Dave Newton <da...@solaraccess.com>.
On Fri, 2003-02-28 at 14:05, Darcee Thomason wrote:
> Could someone please tell me why this does not work?

Doubtful from what little you've given us.

Are you running a mailserver? Did you check the mailserver logs? Did you
check the servlet container logs to see if there are any messages there?
Are any exceptions thrown?

Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


RE: mail help

Posted by Jerome Jacobsen <je...@gentootech.com>.
I've never used that tag, but I just looked at the documentation.  What you
are doing looks OK to me as long as you have an SMTP server on the same
machine from which you are running your JSP.  If the SMTP server is not on
the same machine you must supply the "server" attribute to the mt:mail tag.

When you say it doesn't work, what happens?  Do you get an error message
somewhere?  Check your JSP containers logs.

> -----Original Message-----
> From: Darcee Thomason [mailto:darcee@involved.com]
> Sent: Friday, February 28, 2003 2:06 PM
> To: taglibs-user@jakarta.apache.org
> Subject: mail help
>
>
>
> I am new to this JSP taglib thing.  Could someone please tell me why this
> does not work?  Thank you.
>
> -D
>
> <%@ taglib uri="http://jakarta.apache.org/taglibs/mailer-1.1"
> prefix="mt" %>
>
> <html>
> <head>
> </head>
> <body>
> <%String body = request.getParameter("body");
> String to = request.getParameter("to");
> String from = request.getParameter("from");
> String subject = request.getParameter("subject");
> %>
>
> <mt:mail  to="<%= to %>"
> from="<%= from %>"  subject="<%= subject %>" >
>      <mt:message>"<%= body %>" </mt:message>
>      <mt:send/>
> </mt:mail>
>
> </body>
> </html>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org