]
George Gastaldi updated FORGE-2410:
-----------------------------------
Labels: Starter (was: )
Being able to add a mail session definition
--------------------------------------------
Key: FORGE-2410
URL:
https://issues.jboss.org/browse/FORGE-2410
Project: Forge
Issue Type: Sub-task
Components: Java EE
Affects Versions: 2.17.0.Final
Reporter: Antonio Goncalves
Labels: Starter
Fix For: 2.x Future
It would be good to have a command to quickly add a new {{MailSessionDefinition}} to
allow sending an email :
{code}
email-add-session-definition --named java:comp/myMailSession --host
smtp.gmail.com
--transportProtocol smtps
{code}
This will create a new class called {{org.myproject.email.MailResources}} if it
doesn't exist, and will add a new {{MailSessionDefinition}} :
{code}
package org.myproject.email;
@MailSessionDefinitions({
@MailSessionDefinition(
name = "java:comp/myMailSession",
host = "smtp.gmail.com",
transportProtocol = "smtps"
)
})
public class MailResources {
}
{code}
Tying the command a second time will add a new {{MailSessionDefinition}} to the exiting
{{MailSessionDefinitions}} :
{code}
package org.myproject.email;
@MailSessionDefinition(
name = "java:comp/myMailSession",
host = "smtp.gmail.com",
transportProtocol = "smtps"
),
@MailSessionDefinition(
...
)
})
public class MailResources {
}
{code}