简体   繁体   中英

How to use seam mail with jboss As 7.0.2?

I try to send mail with seam 2.3.0.Final and jbossAs 7.0.2
I send mail with seam facility, my bean code :

String path = /** some Path to email template**/
        try
        {
            renderer.render(path);
        }
        catch (Exception e)
        {
            log.error(e.getMessage());
            throw new Exception(e);
        }  

In my component.xml :

<mail:mail-session host="smtp.gmail.com"
        username="user@domain.com"
        password="xxxx"
        ssl="true"
        tls="false"
        port="465"/>

I know that JBossAs 7.1.x has support for mail (which allows jndi's mail-session configuration) but this is not a option for us.
When I send an email, I get this error :

javax.mail.NoSuchProviderException: No provider for smtps  

Am I missing something or is it just not possible like that? If not do you think there could be a workaround?

Check classpath of your app ( .ear.list/ .war.list files, if I'm not mistaken). Here this link .
In our project we also used it, but it is not flexible and may soon not satisfy your needs (also low performance issue, etc), the sooner you switch to apache mail (or something) the better.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM