Hi
I have the next problem.
Now I use Jboss 5.1.0.GA, and cannot deploy a second javamail service when start jboss.
The file name is
custom-mail-service.xml and contains:
<?xml version="1.0" encoding="UTF-8"?> <server> <mbean code="org.jboss.mail.MailService" name="jboss:service=CustomMail"> <attribute name="JNDIName">java:/Custom.Mail</attribute> <attribute name="User">jboss</attribute> <attribute name="Password">123456</attribute> <attribute name="Configuration"> <configuration> <!-- Change to your mail server prototocol --> <property name="mail.store.protocol" value="pop3"/> <property name="mail.transport.protocol" value="smtp"/> <!-- Change to the user who will receive mail --> <property name="mail.user" value="nobody"/> <!-- Change to the mail server --> <property name="mail.pop3.host" value="localhost"/> <!-- Change to the SMTP gateway server --> <property name="mail.smtp.host" value="10.0.0.51"/> <property name="mail.smtp.port" value="25"/> <!-- Change to the address mail will be from --> <!-- <property name="mail.from" value="jboss@localhost"/>--> <!-- Enable debugging output from the javamail classes --> <property name="mail.debug" value="true"/> </configuration> </attribute> <depends>jboss:service=Naming</depends> </mbean> </server>
try { InitialContext initialContext = new InitialContext(); return (Session) initialContext.lookup("java:/Custom.Mail"); } catch (NamingException e) { log.error("-> Read SMTP configuration from Server FAIL ", e); }