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 Dean Singley <de...@gtri.gatech.edu> on 2003/04/03 22:16:22 UTC

mailer taglib - How to write database data into mail tags?

Hi All,

I've been trying to put emails read from a MySQL database into the body
of the mailer taglib "setrecipient", "addrecipient" and "replyto" tags
as follows:

<mt:mail subject = "New Record In Bug Tracker">
	<mt:setrecipient type = "to"><sql:getColumn colName =
"email_to_1"/></mt:setrecipient>
	<mt:addrecipient type = "to"><sql:getColumn colName =
"email_to_2"/></mt:addrecipient>
      <mt:from>dean.singley@gtri.gatech.edu</mt:from>
      <mt:replyto><sql:getColumn colName =
"email_reply_to"/></mt:replyto>
                    
      <mt:server>casbah.gatech.edu</mt:server>
      <mt:message>
	This is a message.
      </mt:message>
      <mt:send/> 
</mt:mail> 

This doesn't work; I receive the following error:
javax.servlet.ServletException: javax/mail/Authenticator

However, when I specify emails as follows:

<mt:mail subject = "New Record In Bug Tracker">
	<mt:setrecipient type =
"to">someone1@someplace1.com</mt:setrecipient>
	<mt:addrecipient type =
"to">someone2@someplace2.com</mt:addrecipient>
	<mt:from>dean.singley@gtri.gatech.edu</mt:from>
	<mt:replyto>someone3@someplace3.com</mt:replyto>
                    
	<mt:server>casbah.gatech.edu</mt:server>
	<mt:message>
	This is a message.
	</mt:message>
	<mt:send/> 
</mt:mail>

I receive no such error.  Any thoughts as to the cause?

Thanks,

Dean


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