fable.utility
Class MailSender

java.lang.Object
  extended by fable.utility.MailSender

public class MailSender
extends java.lang.Object

This class is used to send mail

Author:
Christopher Moh

Method Summary
static boolean sendMail(java.lang.String from, java.lang.String mailAddr, java.lang.String title, java.lang.String body, boolean sendAsText, java.lang.String attachment)
          Sends email
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

sendMail

public static boolean sendMail(java.lang.String from,
                               java.lang.String mailAddr,
                               java.lang.String title,
                               java.lang.String body,
                               boolean sendAsText,
                               java.lang.String attachment)
Sends email

Parameters:
from - The name of the sender
mailAddr - The email address of the receiver
title - Subject of the email
body - Body of the email
sendAsText - true if to send as a text file, false if to send as html
attachment - One attachment to send with this mail, or null if there are none. If there is an attachment, the string should be the path of the attachment file.
Returns:
true if the mail can be sent, false otherwise
Requires:
from, mailAddr, title, body != null