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