Mail class now support authentication for SMTP
git-svn-id: https://svn.libreccm.org/ccm/trunk@3958 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
3ae76d3d39
commit
4858e92f0a
|
|
@ -264,6 +264,13 @@ public class Mail implements MessageType {
|
||||||
throws MessagingException,
|
throws MessagingException,
|
||||||
SendFailedException {
|
SendFailedException {
|
||||||
Transport transport = getSession().getTransport();
|
Transport transport = getSession().getTransport();
|
||||||
|
Properties properties = getConfig().getJavamail();
|
||||||
|
if ("true".equals(properties.getProperty("mail.smtp.auth"))) {
|
||||||
|
transport.connect(properties.getProperty("mail.smtp.user"),
|
||||||
|
properties.getProperty("mail.smtp.password"));
|
||||||
|
} else {
|
||||||
|
transport.connect();
|
||||||
|
}
|
||||||
transport.connect();
|
transport.connect();
|
||||||
send(transport);
|
send(transport);
|
||||||
transport.close();
|
transport.close();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue