could anybody tell me if it is possible to send email from localhost using JBoss AS-5.1 + Seam-2.2?
I've tryed launching mail example which goes with Seam, but the result is unsatisfactory. Clicking the "Send Plain Text Email" button leads to the following message:
Email sending failed: Could not connect to SMTP host: localhost, port: 2525
However, sending a letter "from inside a servlet" gives me a success page. Alas, no email really comes to the target address.
The example page says I could have firewall enabled, which might block email sending. But I haven't installed any firewalls or enabled the existing ones. My OS is ubuntu-9.04. As far as I know, the default firewall configuration 开发者_JAVA技巧tool for this system is ufw and it is disabled by default.
Does anybody know how to deal with the situation?
UPD: Suppose, I should clarify my message. As for now, I try to send email via seam example application and all the errors and buttons I mentioned above refer to this example, not my own program.
Here's the screenshot:
mail example http://pics.livejournal.com/emanemos/pic/00011asb
JBossAS deploys a mail service as part of its standard configuration. The mail service takes the form of a javax.mail.Session
, and is bound to JNDI under java:/Mail
. Applications can make use of this mail service in order to send mail via SMTP.
My guess is that your seam app is trying to send mail by one method, and your servlet app by another method. Judging by the error message you're getting the servlet app is doing it using the JBossAS mail service, and the seam app is trying to do it all itself.
In order to configure the JBoss mail service, you need to edit the deploy/mail-service.xml
file under the server directory.
As for the Seam app, you need to find out how it's doing mail handling, and configure it seperately to the JBossAS mail service. Better yet, change it to use the JBossAS mail service.
精彩评论