|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.groiss.util.MailSender
public class MailSender
Use the methods in this class for sending SMTP mails.
Constructor Summary | |
---|---|
MailSender()
|
Method Summary | |
---|---|
static java.lang.String |
getSMTPHost()
|
static boolean |
send(java.lang.String[] to,
java.lang.String[] cc,
java.lang.String[] bcc,
java.lang.String from,
java.lang.String host,
java.lang.String subject,
java.lang.String msgText,
java.lang.Object[] parts,
java.lang.String[] fileNames)
Method for sending mails with attachments |
static boolean |
send(java.lang.String[] to,
java.lang.String[] cc,
java.lang.String[] bcc,
java.lang.String from,
java.lang.String host,
java.lang.String subject,
java.lang.String msgText,
java.lang.String contentType,
java.lang.Object[] parts,
java.lang.String[] fileNames)
|
static boolean |
send(java.lang.String[] to,
java.lang.String[] cc,
java.lang.String[] bcc,
java.lang.String from,
java.lang.String host,
java.lang.String subject,
java.lang.String msgText,
java.lang.String charset,
java.lang.String contentType,
java.lang.Object[] parts,
java.lang.String[] fileNames)
|
static boolean |
send(java.lang.String[] to,
java.lang.String from,
java.lang.String host,
java.lang.String subject,
java.lang.String msgText,
java.lang.String contentType)
Method for sending mails without attachments. |
static boolean |
send(java.lang.String[] to,
java.lang.String from,
java.lang.String host,
java.lang.String subject,
java.lang.String msgText,
java.lang.String[] files)
Method for sending mails with attachments |
static boolean |
send(java.lang.String to,
java.lang.String from,
java.lang.String host,
java.lang.String subject,
java.lang.String msgText)
Method for sending mails without attachments. |
static boolean |
send(java.lang.String to,
java.lang.String from,
java.lang.String host,
java.lang.String subject,
java.lang.String msgText,
java.lang.String contentType)
Method for sending mails without attachments. |
static void |
sendToAdmin(java.lang.String message)
Send a message to the system administrator. |
static void |
sendToAdmin(java.lang.String subject,
java.lang.String message)
Send a message to the system administrator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MailSender()
Method Detail |
---|
public static boolean send(java.lang.String to, java.lang.String from, java.lang.String host, java.lang.String subject, java.lang.String msgText)
to
- the recipientfrom
- the senderhost
- the mailer hostsubject
- the subject textmsgText
- the message text
public static boolean send(java.lang.String to, java.lang.String from, java.lang.String host, java.lang.String subject, java.lang.String msgText, java.lang.String contentType)
to
- the recipientfrom
- the senderhost
- the mailer hostsubject
- the subject textmsgText
- the message textcontentType
- the mime-type
public static boolean send(java.lang.String[] to, java.lang.String from, java.lang.String host, java.lang.String subject, java.lang.String msgText, java.lang.String contentType)
to
- the recipientsfrom
- the senderhost
- the mailer hostsubject
- the subject textmsgText
- the message textcontentType
- the mime-type
public static boolean send(java.lang.String[] to, java.lang.String from, java.lang.String host, java.lang.String subject, java.lang.String msgText, java.lang.String[] files)
to
- the recipientfrom
- the senderhost
- the mailer hostsubject
- the subject textmsgText
- the message textfiles
- the attached files (path names). These files will be attached with their
real filenames.
public static boolean send(java.lang.String[] to, java.lang.String[] cc, java.lang.String[] bcc, java.lang.String from, java.lang.String host, java.lang.String subject, java.lang.String msgText, java.lang.Object[] parts, java.lang.String[] fileNames)
to
- the recipient(s)cc
- the cc recipient(s)bcc
- the bcc recipient(s)from
- the senderhost
- the mailer hostsubject
- the subject textmsgText
- the message textparts
- the attached mime body parts or files (path names leading to the files,
thus, a String[]
).
If the parameter contains paths to files, you can use the next parameter
fileNames
to give names to the files.fileNames
- if parts
contains files, then you can provide filenames
in this array. Ensure that it has a name for every file listed in the parts
array.
The first element of the parts
array will be given the first name from the
fileNames
array. If you set fileNames
to null
,
the real file names of the files will be used.
public static boolean send(java.lang.String[] to, java.lang.String[] cc, java.lang.String[] bcc, java.lang.String from, java.lang.String host, java.lang.String subject, java.lang.String msgText, java.lang.String contentType, java.lang.Object[] parts, java.lang.String[] fileNames)
public static boolean send(java.lang.String[] to, java.lang.String[] cc, java.lang.String[] bcc, java.lang.String from, java.lang.String host, java.lang.String subject, java.lang.String msgText, java.lang.String charset, java.lang.String contentType, java.lang.Object[] parts, java.lang.String[] fileNames)
public static void sendToAdmin(java.lang.String message)
message
- the messagepublic static void sendToAdmin(java.lang.String subject, java.lang.String message)
subject
- the subjectmessage
- the messagepublic static java.lang.String getSMTPHost()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |