public class SendEmail
extends java.lang.Object
Constructor and Description |
---|
SendEmail(java.lang.String MAIL_TYPE,
java.lang.String MAIL_SERVER)
Constructor for the SendEmail object
|
Modifier and Type | Method and Description |
---|---|
boolean |
doSend(java.lang.String[] msgTo,
java.lang.String msgFrom,
java.lang.String msgSubject,
java.lang.String msgBody)
Sends email to the given address(es).
|
boolean |
doSend(java.lang.String msgTo,
java.lang.String msgFrom,
java.lang.String msgSubject,
java.lang.String msgBody)
Sends email to the given address.
|
void |
doSendEmail(java.lang.String[] toAddresses,
java.lang.String fromAddress,
java.lang.String msgSubject,
java.lang.String msgBody)
Sends email to the given address(es).
|
public SendEmail(java.lang.String MAIL_TYPE, java.lang.String MAIL_SERVER)
MAIL_TYPE
- The mail type, for example 'mail.smtp.host'MAIL_SERVER
- The mail server, for example 'localhost', 'my-mail-server'public void doSendEmail(java.lang.String[] toAddresses, java.lang.String fromAddress, java.lang.String msgSubject, java.lang.String msgBody) throws javax.mail.MessagingException
toAddresses
- To address(es)fromAddress
- From addressmsgSubject
- Email subject linemsgBody
- Email content bodyjavax.mail.MessagingException
- If errorpublic boolean doSend(java.lang.String[] msgTo, java.lang.String msgFrom, java.lang.String msgSubject, java.lang.String msgBody)
msgTo
- To address(es)msgFrom
- From addressmsgSubject
- SubjectmsgBody
- Message bodypublic boolean doSend(java.lang.String msgTo, java.lang.String msgFrom, java.lang.String msgSubject, java.lang.String msgBody)
msgTo
- To addressmsgFrom
- From addressmsgSubject
- SubjectmsgBody
- Message body