bug#19589

dev:lucas

qua:

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@105934 d1611594-4594-4d17-8e1d-87c2c4800839
master
lucas.taia 2021-03-25 20:35:58 +00:00
parent 068c571cab
commit 54e9a5bf04
1 changed files with 20 additions and 1 deletions

View File

@ -38,6 +38,8 @@ public class SendMail implements java.io.Serializable {
private static final String ENCODE_UTF_8 = "UTF-8";
private static final long serialVersionUID = 2067442255080001075L;
public enum AuthType {TLS,SSL}
private String smtpHost;
private String smtpUser;
@ -54,6 +56,7 @@ public class SendMail implements java.io.Serializable {
private Map<String, ByteArrayOutputStream> anexosBytes;
private Map<String, String> anexosArquivos;
private Map<String, MimeType> mimeTypes;
private AuthType authType;
public SendMail(){
this.smtpHost = "";
@ -63,6 +66,7 @@ public class SendMail implements java.io.Serializable {
this.emailFrom = "";
this.localhost = "";
this.auth = true;
this.authType = AuthType.TLS;
this.emailTo = "";
this.emailToCO = "";
}
@ -250,7 +254,13 @@ public class SendMail implements java.io.Serializable {
}
if (auth) {
props.setProperty("mail.smtp.starttls.enable", "true");
if (authType.equals(AuthType.TLS)) {
props.setProperty("mail.smtp.starttls.enable", "true");
} else {
props.put("mail.smtp.socketFactory.port", smtpPort);
props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
}
props.setProperty("mail.smtp.user", smtpUser);
}
@ -393,4 +403,13 @@ public class SendMail implements java.io.Serializable {
public void setAnexosArquivos(Map<String, String> anexosArquivos) {
this.anexosArquivos = anexosArquivos;
}
public AuthType getAuthType() {
return authType;
}
public void setAuthType(AuthType authType) {
this.authType = authType;
}
}