Mail.java

  1. /*
  2.  * GovWay - A customizable API Gateway
  3.  * https://govway.org
  4.  *
  5.  * Copyright (c) 2005-2025 Link.it srl (https://link.it).
  6.  *
  7.  * This program is free software: you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License version 3, as published by
  9.  * the Free Software Foundation.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  *
  19.  */

  20. package org.openspcoop2.utils.mail;

  21. import java.util.ArrayList;
  22. import java.util.List;

  23. import org.openspcoop2.utils.transport.http.SSLConfig;

  24. /**
  25.  * Mail
  26.  *
  27.  * @author Poli Andrea (apoli@link.it)
  28.  * @author $Author$
  29.  * @version $Rev$, $Date$
  30.  */
  31. public class Mail {

  32.     private String serverHost;
  33.     private int serverPort;
  34.     private String username;
  35.     private String password;
  36.     private SSLConfig sslConfig;
  37.     private boolean startTls;
  38.    
  39.     private String encoding = "UTF8";
  40.    
  41.     private String from;
  42.     private String to;
  43.     private List<String> cc = new ArrayList<>();    
  44.     private String subject;
  45.    
  46.     private String userAgent;
  47.     private String contentLanguage;
  48.     private String messageIdDomain;
  49.    
  50.     private MailBody body = new MailBody();
  51.    
  52.     public String getServerHost() {
  53.         return this.serverHost;
  54.     }

  55.     public void setServerHost(String serverHost) {
  56.         this.serverHost = serverHost;
  57.     }

  58.     public int getServerPort() {
  59.         return this.serverPort;
  60.     }

  61.     public void setServerPort(int serverPort) {
  62.         this.serverPort = serverPort;
  63.     }

  64.     public String getUsername() {
  65.         return this.username;
  66.     }

  67.     public void setUsername(String username) {
  68.         this.username = username;
  69.     }

  70.     public String getPassword() {
  71.         return this.password;
  72.     }

  73.     public void setPassword(String password) {
  74.         this.password = password;
  75.     }

  76.     public SSLConfig getSslConfig() {
  77.         return this.sslConfig;
  78.     }

  79.     public void setSslConfig(SSLConfig sslConfig) {
  80.         this.sslConfig = sslConfig;
  81.     }

  82.     public boolean isStartTls() {
  83.         return this.startTls;
  84.     }

  85.     public void setStartTls(boolean startTls) {
  86.         this.startTls = startTls;
  87.     }

  88.     public String getFrom() {
  89.         return this.from;
  90.     }

  91.     public void setFrom(String from) {
  92.         this.from = from;
  93.     }

  94.     public String getTo() {
  95.         return this.to;
  96.     }

  97.     public void setTo(String to) {
  98.         this.to = to;
  99.     }

  100.     public List<String> getCc() {
  101.         return this.cc;
  102.     }

  103.     public void setCc(List<String> cc) {
  104.         this.cc = cc;
  105.     }

  106.     public String getSubject() {
  107.         return this.subject;
  108.     }

  109.     public void setSubject(String subject) {
  110.         this.subject = subject;
  111.     }

  112.     public MailBody getBody() {
  113.         return this.body;
  114.     }

  115.     public void setBody(MailBody body) {
  116.         this.body = body;
  117.     }
  118.    
  119.     public String getEncoding() {
  120.         return this.encoding;
  121.     }

  122.     public void setEncoding(String encoding) {
  123.         this.encoding = encoding;
  124.     }
  125.    
  126.     public String getUserAgent() {
  127.         return this.userAgent;
  128.     }

  129.     public void setUserAgent(String userAgent) {
  130.         this.userAgent = userAgent;
  131.     }
  132.    
  133.     public String getContentLanguage() {
  134.         return this.contentLanguage;
  135.     }

  136.     public void setContentLanguage(String contentLanguage) {
  137.         this.contentLanguage = contentLanguage;
  138.     }
  139.    
  140.     public String getMessageIdDomain() {
  141.         return this.messageIdDomain;
  142.     }

  143.     public void setMessageIdDomain(String messageIdDomain) {
  144.         this.messageIdDomain = messageIdDomain;
  145.     }
  146. }