Thanks Martin for your suggestion. The <setrecipient> tag that you have
mentioned below works fine. But it has a limitation, it can be used only
with "to", "cc" fields. We cannot use it to set the "from" or "server"
fields. I have seen the examples given in the mailer1.1 documentation.
It uses the "request" taglib along with the "mailer" taglib. I tried to
use the way example says some thing like this--

<mt:mail>
 <mt:server><req:parameter name="server"/></mt:server>
<mt:setrecipient type="to"><req:parameter name="to"/></mt:setrecipient>
<mt:from><req:parameter name="from"/></mt:from>
        <mt:send> </mt:send>
     </mt:mail>

But this doesn't works. I am posting the values of "to", "from" and
"server" from another jsp page to this jsp page.
Can some body tell a good way of obtaining the values of from and server
without hardcoding them. Previously I was trying to obtain the values
from  beans, but it doesn't works.
Thanks.  

Avinash Arora


-----Original Message-----
From: Martin Cooper [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 26, 2004 4:48 PM
To: Tag Libraries Users List
Subject: RE: mailer taglib

On Fri, 26 Mar 2004, Arora, Avinash wrote:

> Hi,
>    I am using mailer1.1. yes the documentation indicates that run time
> expression is not allowed. So is there any solution or I always have
to
> hardcode the email address in to and from field.

Instead of specifying the addresses as attributes of the <mail> tag, you
can specify them with the <setrecipient> tag, where you can use the body
of the tag for the address, like this:

  <mt:mail ... >
    <mt:setrecipient type="to">
      <%=c.getDnsRecieverEmail()%>
    </mt:setrecipient>
    <mt:setrecipient type="cc">
      <%=c.getDnsSenderEmail()%>
    </mt:setrecipient>
  </mt:mail>

--
Martin Cooper


>
> Avinash Arora
>
>
> -----Original Message-----
> From: Marc Guillemot [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 26, 2004 2:17 AM
> To: [EMAIL PROTECTED]
> Subject: Re: mailer taglib
>
> What version are you using?
> Is it possible that the tld indicates that runtime expressions are not
> allowed?
>
> Marc.
>
> Arora, Avinash wrote:
> > Hi,
> >    I am trying to use the mailer1.1 taglibs to send email. If I
> hardcode
> > the values of to and from field, the email can be send. But when I
use
> a
> > java class to print the value inside to: the mail can not be send. I
> > have checked the value obtained by java class by printing it out. It
> is
> > correct value.
> > Below is the code that I am using with mail tags.
> >
> >
> > <mt:mail server="1.1.1.1" to="<%=c.getDnsRecieverEmail()%>"
> > from="<%=c.getDnsSenderEmail()%>" subject="test mail.">
> >     <mt:message>Congrats u got the mail.</mt:message>
> >     <mt:send/>
> >    </mt:mail>
> > Please let me know what is wrong with the to: and from: in this
case.
> > Also how can I rectify this problem.
> > Thanks.
> >
> >
> >
> >
> >
> >
> >
> > Avinash Arora
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to