1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package tools.gsf.facade.runtag.mail;
18
19 import COM.FutureTense.Interfaces.ICS;
20 import COM.FutureTense.Util.ftErrors;
21 import tools.gsf.facade.runtag.AbstractTagRunner;
22
23
24
25
26
27
28
29
30
31
32
33 public final class Send extends AbstractTagRunner {
34 public Send() {
35 super("mail.send");
36 }
37
38 public void setTo(String commaSeparatedListOfEmailAddresses) {
39 set("to", commaSeparatedListOfEmailAddresses);
40 }
41
42 public void setFrom(String from) {
43 set("from", from);
44 }
45
46 public void setSubject(String subject) {
47 set("subject", subject);
48 }
49
50 public void setBody(String body) {
51 set("body", body);
52 }
53
54 public void setReplyto(String replyto) {
55 set("replyto", replyto);
56 }
57
58 public void setContentType(String contentType) {
59 set("contenttype", contentType);
60 }
61
62 public void setCharset(String charset) {
63 set("charset", charset);
64 }
65
66 public static boolean sendMail(ICS ics, String to, String from, String subject, String body, String replyto,
67 String contentType, String charset) {
68 Send send = new Send();
69 send.setTo(to);
70 send.setFrom(from);
71 send.setSubject(subject);
72 send.setBody(body);
73 send.setReplyto(replyto);
74 send.setContentType(contentType);
75 send.setCharset(charset);
76 send.execute(ics);
77 return ics.GetErrno() != ftErrors.emailexception;
78 }
79
80 public static boolean sendMail(ICS ics, String to, String subject, String body) {
81 return sendMail(ics, to, null, subject, body, null, null, null);
82 }
83
84 }