fixed formatting/indentation

This commit is contained in:
hns 2002-06-11 15:21:36 +00:00
parent f1f9afe13f
commit 6c452b1893

View file

@ -41,14 +41,13 @@ public class ESMail extends ESObject implements Serializable {
public ESMail (MailExtension mailx) { public ESMail (MailExtension mailx) {
super (mailx.esMailPrototype, mailx.evaluator);
super (mailx.esMailPrototype, mailx.evaluator);
this.status = OK; this.status = OK;
this.mailx = mailx; this.mailx = mailx;
this.mprops = mailx.mprops; this.mprops = mailx.mprops;
// create some properties and get the default Session // create some properties and get the default Session
try { try {
Properties props = new Properties(); Properties props = new Properties();
props.put ("mail.smtp.host", mprops.getProperty ("smtp", "mail")); props.put ("mail.smtp.host", mprops.getProperty ("smtp", "mail"));
@ -87,12 +86,12 @@ public class ESMail extends ESObject implements Serializable {
} }
public void addPart (ESValue val[]) throws Exception { public void addPart (ESValue val[]) throws Exception {
if (val == null || val.length == 0) return; if (val == null || val.length == 0) return;
if (multipart == null) { if (multipart == null) {
multipart = new MimeMultipart (); multipart = new MimeMultipart ();
} }
for (int i=0; i<val.length; i++) { for (int i=0; i<val.length; i++) {
// FIXME: addPart is broken. // FIXME: addPart is broken.
MimeBodyPart part = new MimeBodyPart (); MimeBodyPart part = new MimeBodyPart ();
Object obj = val[i].toJavaObject (); Object obj = val[i].toJavaObject ();
if (obj instanceof String) { if (obj instanceof String) {
@ -106,8 +105,8 @@ public class ESMail extends ESObject implements Serializable {
} }
public void setSubject (ESValue val) throws Exception { public void setSubject (ESValue val) throws Exception {
if (val == null) if (val == null)
return; return;
message.setSubject (MimeUtility.encodeWord (val.toString (), "iso-8859-1", null)); message.setSubject (MimeUtility.encodeWord (val.toString (), "iso-8859-1", null));
} }
@ -115,8 +114,8 @@ public class ESMail extends ESObject implements Serializable {
String addstring = add.toString (); String addstring = add.toString ();
if (addstring.indexOf ("@") < 0) if (addstring.indexOf ("@") < 0)
throw new AddressException (); throw new AddressException ();
Address replyTo[] = new Address[1]; Address replyTo[] = new Address[1];
replyTo[0] = new InternetAddress (addstring); replyTo[0] = new InternetAddress (addstring);
message.setReplyTo (replyTo); message.setReplyTo (replyTo);
} }
@ -129,7 +128,7 @@ public class ESMail extends ESObject implements Serializable {
address = new InternetAddress (addstring, MimeUtility.encodeWord (add[1].toString (), "iso-8859-1", null)); address = new InternetAddress (addstring, MimeUtility.encodeWord (add[1].toString (), "iso-8859-1", null));
else else
address = new InternetAddress (addstring); address = new InternetAddress (addstring);
message.setFrom (address); message.setFrom (address);
} }
public void addTo (ESValue add[]) throws Exception { public void addTo (ESValue add[]) throws Exception {
@ -169,26 +168,15 @@ public class ESMail extends ESObject implements Serializable {
} }
public void send () throws Exception { public void send () throws Exception {
if (buffer != null) if (buffer != null)
message.setText (buffer.toString ()); message.setText (buffer.toString ());
else if (multipart != null) else if (multipart != null)
message.setContent (multipart); message.setContent (multipart);
else else
message.setText (""); message.setText ("");
Transport.send (message); Transport.send (message);
} }
} }