1 18 package org.apache.tools.ant.taskdefs.email; 19 20 import java.util.Vector ; 21 import org.apache.tools.ant.BuildException; 22 import org.apache.tools.ant.Task; 23 import org.apache.tools.ant.util.DateUtils; 24 25 30 public abstract class Mailer { 31 protected String host = null; 33 protected int port = -1; 34 protected String user = null; 35 protected String password = null; 36 protected boolean SSL = false; 38 protected Message message; 40 protected EmailAddress from; 41 protected Vector replyToList = null; 42 protected Vector toList = null; 43 protected Vector ccList = null; 44 protected Vector bccList = null; 45 protected Vector files = null; 46 protected String subject = null; 47 protected Task task; 48 protected boolean includeFileNames = false; 49 protected Vector headers = null; 50 52 57 public void setHost(String host) { 58 this.host = host; 59 } 60 61 66 public void setPort(int port) { 67 this.port = port; 68 } 69 70 76 public void setUser(String user) { 77 this.user = user; 78 } 79 80 86 public void setPassword(String password) { 87 this.password = password; 88 } 89 90 96 public void setSSL(boolean ssl) { 97 this.SSL = ssl; 98 } 99 100 105 public void setMessage(Message m) { 106 this.message = m; 107 } 108 109 114 public void setFrom(EmailAddress from) { 115 this.from = from; 116 } 117 118 124 public void setReplyToList(Vector list) { 125 this.replyToList = list; 126 } 127 128 133 public void setToList(Vector list) { 134 this.toList = list; 135 } 136 137 142 public void setCcList(Vector list) { 143 this.ccList = list; 144 } 145 146 151 public void setBccList(Vector list) { 152 this.bccList = list; 153 } 154 155 160 public void setFiles(Vector files) { 161 this.files = files; 162 } 163 164 169 public void setSubject(String subject) { 170 this.subject = subject; 171 } 172 173 178 public void setTask(Task task) { 179 this.task = task; 180 } 181 182 187 public void setIncludeFileNames(boolean b) { 188 this.includeFileNames = b; 189 } 190 191 196 public void setHeaders(Vector v) { 197 this.headers = v; 198 } 199 200 205 public abstract void send() 206 throws BuildException; 207 208 216 protected final String getDate() { 217 return DateUtils.getDateForHeader(); 218 } 219 } 220 221 | Popular Tags |