|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MailSender
A helper component used by the Sendmail
action and the sendmail.xsl
logicsheet for sending email messages.
Please note that this component is not (and can not) be
ThreadSafe
, so you need to lookup
new instance in each processing thread.
Field Summary | |
---|---|
static String |
ROLE
|
Method Summary | |
---|---|
void |
addAttachment(Object attachment)
Add an attachement to the message to be send. |
void |
addAttachment(Object attachment,
String type,
String name)
Add an attachement to the message to be send. |
void |
addAttachmentURL(String url)
Add an attachement to the message to be send. |
void |
addAttachmentURL(String url,
String type,
String name)
Add an attachement to the message to be send. |
Exception |
getException()
Accesses any Exception caught by sendIt(SourceResolver) . |
void |
send()
Assemble the message from the defined fields and send it. |
void |
send(SourceResolver resolver)
Deprecated. Since 2.1.5. Use send() which doesn't require passing the source resolver |
boolean |
sendIt()
Invokes the send() method but catches any exception thrown. |
boolean |
sendIt(SourceResolver resolver)
Deprecated. Since 2.1.5. Use sendIt() which doesn't require passing the source resolver |
void |
setBcc(String bcc)
Sets the address(es), which should receive a black carbon copy of the message. |
void |
setBody(Object body)
Sets the body content of the email message. |
void |
setBody(Object body,
String type)
Sets the body content of the email message. |
void |
setBody(String body)
Deprecated. Since 2.1.10. Use setBody(Object) |
void |
setBodyFromSrc(String src)
Deprecated. Since 2.1.10. Use setBodyURL(String) |
void |
setBodyFromSrcMimeType(String srcMimeType)
Deprecated. Since 2.1.10. Use setBodyURL(String, String) |
void |
setBodyURL(String url)
Sets the body content of the email message. |
void |
setBodyURL(String url,
String type)
Sets the body content of the email message. |
void |
setCc(String cc)
Sets the address(es), which should receive a carbon copy of the message. |
void |
setCharset(String charset)
Deprecated. Since 2.1.10. Use setBody(Object, String) |
void |
setFrom(String from)
Set the from address of the message. |
void |
setReplyTo(String replyTo)
Sets the reply-to address(es) for the message. |
void |
setSmtpHost(String hostname)
Set SMTP hostname to use for mail sending. |
void |
setSmtpHost(String hostname,
String username,
String password)
Set SMTP hostname, username, and password to use for mail sending. |
void |
setSubject(String subject)
Sets the subject line of the message. |
void |
setTo(String to)
Sets the destination address(es) for the message. |
Field Detail |
---|
static final String ROLE
Method Detail |
---|
void setSmtpHost(String hostname)
void setSmtpHost(String hostname, String username, String password)
void setFrom(String from)
from
address of the message.
from
- The address the message appears to be from.void setTo(String to)
InternetAddress.parse(String)
can handle
(one or more email addresses separated by a commas).
to
- the destination address(es)InternetAddress.parse(String)
void setReplyTo(String replyTo)
InternetAddress.parse(String)
can handle
(one or more email addresses separated by a commas).
replyTo
- the address(es) that replies should be sent toInternetAddress.parse(String)
void setCc(String cc)
InternetAddress.parse(String)
can handle
(one or more email addresses separated by a commas).
cc
- the address(es), which should receive a carbon copy.InternetAddress.parse(String)
void setBcc(String bcc)
InternetAddress.parse(String)
can handle
(one or more email addresses separated by a commas).
bcc
- the address(es), which should receive a black carbon copy.InternetAddress.parse(String)
void setSubject(String subject)
subject
- the subject line of the messagevoid setCharset(String charset)
setBody(Object, String)
setBody(String)
.
charset
- the character set to be used for encoding the messagevoid setBody(String body)
setBody(Object)
body
- The body text of the email messagevoid setBodyFromSrc(String src)
setBodyURL(String)
src
- The body source URL of the email messagevoid setBodyFromSrcMimeType(String srcMimeType)
setBodyURL(String, String)
srcMimeType
- The optional body source Mime Type of the email messagevoid setBody(Object body)
The body can be any of: Source
,
Part
, InputStream
,
byte[]
, String
, or a subclass.
body
- The body text of the email messagevoid setBody(Object body, String type)
The body can be any of: Source
,
Part
, InputStream
,
byte[]
, String
, or a subclass.
body
- The body text of the email messagetype
- mime type (optional)void setBodyURL(String url)
url
- URL to use as message bodySource
void setBodyURL(String url, String type)
url
- URL to use as message bodytype
- mime type (optional)Source
void addAttachment(Object attachment)
The attachment can be any of: Source
,
Part
, InputStream
,
byte[]
, String
, or a subclass.
attachment
- to be send with the messagevoid addAttachment(Object attachment, String type, String name)
The attachment can be any of: Source
,
Part
, InputStream
,
byte[]
, String
, or a subclass.
attachment
- to be send with the messagetype
- mime type (optional)name
- attachment name (optional)void addAttachmentURL(String url)
url
- URL to attach to the messageSource
void addAttachmentURL(String url, String type, String name)
url
- URL to attach to the messagetype
- mime type (optional)name
- attachment name (optional)Source
void send() throws AddressException, MessagingException
AddressException
- when problems with email addresses are found
MessagingException
- when message could not be send.void send(SourceResolver resolver) throws AddressException, MessagingException
send()
which doesn't require passing the source resolver
AddressException
- when problems with email addresses are found
MessagingException
- when message could not be send.boolean sendIt()
send()
method but catches any exception thrown. This
method is intended to be used from the sendmail logicsheet. The source
resolver is obtained from the hosting component container.
boolean sendIt(SourceResolver resolver)
sendIt()
which doesn't require passing the source resolver
send(SourceResolver)
method but catches any exception thrown.
This method is intended to be used from the sendmail logicsheet.
Exception getException()
sendIt(SourceResolver)
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |