これを試して:
<%@ taglib uri="http://jakarta.apache.org/taglibs/mailer-1.1" prefix="mt" %>
<mt:mail session="java:/comp/env/mail/Session" to="foo@home.net" from="registration@mydomain.de" subject="Registration Confirmation">
<mt:message type="html"><h1>Perfect</h1>Super</mt:message>
<mt:send/>
</mt:mail>
したがって、 /META-INF/context.xml には次が含まれている必要があります。
<?xml version='1.0' encoding='utf-8'?>
<Context>
<Resource name="mail/Session"
auth="Container"
type="javax.mail.Session"
username="webmaster@mydomain.de"
password="password"
mail.debug="true"
mail.user="webmaster@mydomain.de"
mail.from="registration@mydomain.de"
mail.transport.protocol="smtp"
mail.smtp.host="smtp.strato.de"
mail.smtp.auth="true"/>
</Context>
/WEB-INF/web.xml には以下が含まれている必要があります。
...
<resource-ref>
<res-ref-name>mail/Session</res-ref-name>
<res-type>javax.mail.Session</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web>
注:
context.xml が存在しない場合は、jboss-server にコピーされます。これは、アプリケーションサーバーが環境の構成(ライブ、テスト、ステージング)を異なる方法です。
注:
tomcat/lib-directory に mail.jar、mailer-1.1.jar、および mail-1.4.4.jar が必要です (アプリケーションがデプロイされていなくても、context.xml を使用できるためです)。