Subversion Repositories bacoAlunos

Compare Revisions

Ignore whitespace Rev 1439 → Rev 1440

/branches/v3/impl/src/java/pt/estgp/estgweb/services/email/SendEmailService.java
61,13 → 61,14
//Properties props = System.getProperties();
Properties props = new Properties();
props.put("mail.smtp.host", Globals.EMAIL_SERVER_HOST);
props.setProperty("mail.transport.protocol", "smtp");//todo new
final String username = Globals.EMAIL_SERVER_USERNAME;
final String password = Globals.EMAIL_SERVER_PASSWORD;
javax.mail.Authenticator authenticator = null;
if(Globals.SYSTEM_EMAIL_USE_SECURITY && Globals.EMAIL_SERVER_SECURITY != null && Globals.EMAIL_SERVER_SECURITY.compareTo("TLS")==0)
{
logger.info("Using Email Security TLS");
props.setProperty("mail.transport.protocol", "smtp");//todo new
 
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.smtp.port", ""+ Globals.EMAIL_SERVER_SECURITY_TLS);
82,7 → 83,7
else if(Globals.SYSTEM_EMAIL_USE_SECURITY && Globals.EMAIL_SERVER_SECURITY != null && Globals.EMAIL_SERVER_SECURITY.compareTo("SSL")==0)
{
logger.info("Using Email Security SSL");
props.setProperty("mail.transport.protocol", "smtp");//todo new
 
props.put("mail.smtp.socketFactory.port", Globals.EMAIL_SERVER_SECURITY_SSL);
props.put("mail.smtp.socketFactory.class",
"javax.net.ssl.SSLSocketFactory");