bug#19589
dev:lucas qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@105934 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
068c571cab
commit
54e9a5bf04
|
@ -39,6 +39,8 @@ public class SendMail implements java.io.Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 2067442255080001075L;
|
private static final long serialVersionUID = 2067442255080001075L;
|
||||||
|
|
||||||
|
public enum AuthType {TLS,SSL}
|
||||||
|
|
||||||
private String smtpHost;
|
private String smtpHost;
|
||||||
private String smtpUser;
|
private String smtpUser;
|
||||||
private String smtpPassword;
|
private String smtpPassword;
|
||||||
|
@ -54,6 +56,7 @@ public class SendMail implements java.io.Serializable {
|
||||||
private Map<String, ByteArrayOutputStream> anexosBytes;
|
private Map<String, ByteArrayOutputStream> anexosBytes;
|
||||||
private Map<String, String> anexosArquivos;
|
private Map<String, String> anexosArquivos;
|
||||||
private Map<String, MimeType> mimeTypes;
|
private Map<String, MimeType> mimeTypes;
|
||||||
|
private AuthType authType;
|
||||||
|
|
||||||
public SendMail(){
|
public SendMail(){
|
||||||
this.smtpHost = "";
|
this.smtpHost = "";
|
||||||
|
@ -63,6 +66,7 @@ public class SendMail implements java.io.Serializable {
|
||||||
this.emailFrom = "";
|
this.emailFrom = "";
|
||||||
this.localhost = "";
|
this.localhost = "";
|
||||||
this.auth = true;
|
this.auth = true;
|
||||||
|
this.authType = AuthType.TLS;
|
||||||
this.emailTo = "";
|
this.emailTo = "";
|
||||||
this.emailToCO = "";
|
this.emailToCO = "";
|
||||||
}
|
}
|
||||||
|
@ -250,7 +254,13 @@ public class SendMail implements java.io.Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (auth) {
|
if (auth) {
|
||||||
|
if (authType.equals(AuthType.TLS)) {
|
||||||
props.setProperty("mail.smtp.starttls.enable", "true");
|
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);
|
props.setProperty("mail.smtp.user", smtpUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -393,4 +403,13 @@ public class SendMail implements java.io.Serializable {
|
||||||
public void setAnexosArquivos(Map<String, String> anexosArquivos) {
|
public void setAnexosArquivos(Map<String, String> anexosArquivos) {
|
||||||
this.anexosArquivos = anexosArquivos;
|
this.anexosArquivos = anexosArquivos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AuthType getAuthType() {
|
||||||
|
return authType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuthType(AuthType authType) {
|
||||||
|
this.authType = authType;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue