| org.apache.cocoon.mail.MailSender
All known Subclasses: org.apache.cocoon.mail.MailMessageSender,
MailSender | public interface MailSender (Code) | | A helper component used by the
org.apache.cocoon.acting.Sendmail action and the sendmail.xsl logicsheet for sending email messages.
Please note that this component is not (and can not) be
org.apache.avalon.framework.thread.ThreadSafe , so you need to lookup
new instance in each processing thread.
since: 2.1.5 version: $Id: MailSender.java 469258 2006-10-30 20:21:40Z vgritsenko $ |
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
MailSender.sendIt(SourceResolver) . | void | send() Assemble the message from the defined fields and send it. | void | send(SourceResolver resolver) Assemble the message from the defined fields and send it. | boolean | sendIt() Invokes the
MailSender.send() method but catches any exception thrown. | boolean | sendIt(SourceResolver resolver) Invokes the
MailSender.send(SourceResolver) method but catches any exception thrown. | void | setBcc(String bcc) Sets the address(es), which should receive a black carbon copy of
the message. | void | setBody(String body) Sets the body text of the email 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 | setBodyFromSrc(String src) Sets the body source URL of the email message. | void | setBodyFromSrcMimeType(String srcMimeType) Sets the optional body source Mime Type of the email message. | 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) Sets the character set for encoding the message. | 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. |
addAttachmentURL | void addAttachmentURL(String url)(Code) | | Add an attachement to the message to be send.
Parameters: url - URL to attach to the message See Also: org.apache.excalibur.source.Source |
addAttachmentURL | void addAttachmentURL(String url, String type, String name)(Code) | | Add an attachement to the message to be send.
Parameters: url - URL to attach to the message Parameters: type - mime type (optional) Parameters: name - attachment name (optional) See Also: org.apache.excalibur.source.Source |
send | void send() throws AddressException, MessagingException(Code) | | Assemble the message from the defined fields and send it. The source resolver
is obtained from the hosting component container.
throws: AddressException - when problems with email addresses are found throws: MessagingException - when message could not be send. |
send | void send(SourceResolver resolver) throws AddressException, MessagingException(Code) | | Assemble the message from the defined fields and send it.
throws: AddressException - when problems with email addresses are found throws: MessagingException - when message could not be send.MailSender.send() |
sendIt | boolean sendIt()(Code) | | Invokes the
MailSender.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.
true when successful |
setBcc | void setBcc(String bcc)(Code) | | Sets the address(es), which should receive a black carbon copy of
the message. The address is in the format, that
javax.mail.internet.InternetAddress.parse(String) can handle
(one or more email addresses separated by a commas).
Parameters: bcc - the address(es), which should receive a black carbon copy. See Also: javax.mail.internet.InternetAddress.parse(String) |
setBody | void setBody(String body)(Code) | | Sets the body text of the email message.
If both a text body and a body read from a source are set,
only the latter will be used.
Parameters: body - The body text of the email messageMailSender.setBody(Object) |
setBodyFromSrc | void setBodyFromSrc(String src)(Code) | | Sets the body source URL of the email message.
If both a text body and a body read from a source are set,
only the latter will be used.
Parameters: src - The body source URL of the email messageMailSender.setBodyURL(String) |
setBodyFromSrcMimeType | void setBodyFromSrcMimeType(String srcMimeType)(Code) | | Sets the optional body source Mime Type of the email message.
Parameters: srcMimeType - The optional body source Mime Type of the email messageMailSender.setBodyURL(String,String) |
setBodyURL | void setBodyURL(String url)(Code) | | Sets the body content of the email message.
Parameters: url - URL to use as message body See Also: org.apache.excalibur.source.Source |
setBodyURL | void setBodyURL(String url, String type)(Code) | | Sets the body content of the email message.
Parameters: url - URL to use as message body Parameters: type - mime type (optional) See Also: org.apache.excalibur.source.Source |
setCc | void setCc(String cc)(Code) | | Sets the address(es), which should receive a carbon copy of the
message. The address is in the format, that
javax.mail.internet.InternetAddress.parse(String) can handle
(one or more email addresses separated by a commas).
Parameters: cc - the address(es), which should receive a carbon copy. See Also: javax.mail.internet.InternetAddress.parse(String) |
setFrom | void setFrom(String from)(Code) | | Set the from address of the message.
Parameters: from - The address the message appears to be from. |
setReplyTo | void setReplyTo(String replyTo)(Code) | | Sets the reply-to address(es) for the message. The address
is in the format, that
javax.mail.internet.InternetAddress.parse(String) can handle
(one or more email addresses separated by a commas).
Parameters: replyTo - the address(es) that replies should be sent to See Also: javax.mail.internet.InternetAddress.parse(String) |
setSmtpHost | void setSmtpHost(String hostname)(Code) | | Set SMTP hostname to use for mail sending.
|
setSmtpHost | void setSmtpHost(String hostname, String username, String password)(Code) | | Set SMTP hostname, username, and password to use for mail sending.
|
setSubject | void setSubject(String subject)(Code) | | Sets the subject line of the message.
Parameters: subject - the subject line of the message |
setTo | void setTo(String to)(Code) | | Sets the destination address(es) for the message. The address
is in the format, that
javax.mail.internet.InternetAddress.parse(String) can handle
(one or more email addresses separated by a commas).
Parameters: to - the destination address(es) See Also: javax.mail.internet.InternetAddress.parse(String) |
|
|