|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.cocoon.util.AbstractLogEnabled
org.apache.cocoon.mail.MailMessageSender
A helper class used by the Sendmail
and the sendmail.xsl logicsheet for sending an email message.
| smtp-host | SMTP server to use sending mail. | opt | String | localhost |
|---|---|---|---|---|
| smtp-user | User name for authentication | opt | String | |
| smtp-password | Password for authentication | opt | String |
| Field Summary |
| Fields inherited from interface org.apache.cocoon.mail.MailSender |
ROLE |
| Constructor Summary | |
MailMessageSender()
|
|
MailMessageSender(String smtpHost)
Deprecated. Since 2.1.5. Please use MailSender component instead. |
|
| 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. |
void |
configure(Configuration config)
|
Exception |
getException()
Accesses any Exception caught by sendIt(org.apache.cocoon.environment.SourceResolver). |
void |
initialize()
|
void |
send()
Assemble the message from the defined fields and send it. |
void |
send(org.apache.cocoon.environment.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(org.apache.cocoon.environment.SourceResolver resolver)
Deprecated. Since 2.1.5. Use sendIt() which doesn't require passing the source resolver |
void |
service(ServiceManager manager)
|
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)
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 |
setSubject(String subject,
String charset)
Sets the subject line of the message. |
void |
setTo(String to)
Sets the destination address(es) for the message. |
| Methods inherited from class org.apache.cocoon.util.AbstractLogEnabled |
getLogger, setLogger |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public MailMessageSender()
public MailMessageSender(String smtpHost)
MailSender component instead.
smtpHost - The host name or ip-address of a host to accept
the email for delivery.| Method Detail |
public void service(ServiceManager manager)
service in interface Serviceable
public void configure(Configuration config)
throws ConfigurationException
configure in interface ConfigurableConfigurationExceptionpublic void initialize()
initialize in interface Initializablepublic void setSmtpHost(String hostname)
MailSender
setSmtpHost in interface MailSender
public void setSmtpHost(String hostname,
String username,
String password)
MailSender
setSmtpHost in interface MailSender
public void send()
throws AddressException,
MessagingException
send in interface MailSenderAddressException - when problems with email addresses are found
MessagingException - when message could not be send.
public void send(org.apache.cocoon.environment.SourceResolver resolver)
throws AddressException,
MessagingException
send() which doesn't require passing the source resolver
send in interface MailSenderAddressException - when problems with email addresses are found
MessagingException - when message could not be send.public boolean sendIt()
send() method but catches any exception thrown. This
method is intended to be used from the sendmail logicsheet.
sendIt in interface MailSenderpublic boolean sendIt(org.apache.cocoon.environment.SourceResolver resolver)
sendIt() which doesn't require passing the source resolver
send(org.apache.cocoon.environment.SourceResolver)
method but catches any exception thrown. This
method is intended to be used from the sendmail logicsheet.
sendIt in interface MailSenderpublic Exception getException()
sendIt(org.apache.cocoon.environment.SourceResolver).
getException in interface MailSenderpublic void setFrom(String from)
from address of the message.
setFrom in interface MailSenderfrom - The address the message appears to be from.public void setTo(String to)
InternetAddress.parse(String) can handle
(one or more email addresses separated by a commas).
setTo in interface MailSenderto - the destination address(es)InternetAddress.parse(String)public void setReplyTo(String replyTo)
InternetAddress.parse(String) can handle
(one or more email addresses separated by a commas).
setReplyTo in interface MailSenderreplyTo - the address(es) that replies should be sent toInternetAddress.parse(String)public void setCc(String cc)
InternetAddress.parse(String) can handle
(one or more email addresses separated by a commas).
setCc in interface MailSendercc - the address(es), which should receive a carbon copy.InternetAddress.parse(String)public void setBcc(String bcc)
InternetAddress.parse(String) can handle
(one or more email addresses separated by a commas).
setBcc in interface MailSenderbcc - the address(es), which should receive a black carbon copy.InternetAddress.parse(String)public void setSubject(String subject)
setSubject in interface MailSendersubject - the subject line of the message
public void setSubject(String subject,
String charset)
setSubject in interface MailSendersubject - the subject line of the messagecharset - the character set to be used for encoding the subjectpublic void setCharset(String charset)
setCharset in interface MailSendercharset - the character set to be used for enbcoding the messagepublic void setBody(String body)
setBody(Object)
setBody in interface MailSenderbody - The body text of the email messagepublic void setBodyFromSrc(String src)
setBodyURL(String)
setBodyFromSrc in interface MailSendersrc - The body source URL of the email messagepublic void setBodyFromSrcMimeType(String srcMimeType)
setBodyURL(String, String)
setBodyFromSrcMimeType in interface MailSendersrcMimeType - The optional body source Mime Type of the email messagepublic void setBody(Object body)
The body can be any of: Source,
Part, InputStream,
byte[], String, or a subclass.
setBody in interface MailSenderbody - The body text of the email message
public void setBody(Object body,
String type)
The body can be any of: Source,
Part, InputStream,
byte[], String, or a subclass.
setBody in interface MailSenderbody - The body text of the email messagetype - mime type (optional)public void setBodyURL(String url)
setBodyURL in interface MailSenderurl - URL to use as message bodySource
public void setBodyURL(String url,
String type)
setBodyURL in interface MailSenderurl - URL to use as message bodytype - mime type (optional)Sourcepublic void addAttachment(Object attachment)
The attachment can be any of: Source,
Part, InputStream,
byte[], String, or a subclass.
addAttachment in interface MailSenderattachment - to be send with the message
public void addAttachment(Object attachment,
String type,
String name)
The attachment can be any of: Source,
Part, InputStream,
byte[], String, or a subclass.
addAttachment in interface MailSenderattachment - to be send with the messagetype - mime type (optional)name - attachment name (optional)public void addAttachmentURL(String url)
addAttachmentURL in interface MailSenderurl - URL to attach to the messageSource
public void addAttachmentURL(String url,
String type,
String name)
addAttachmentURL in interface MailSenderurl - URL to attach to the messagetype - mime type (optional)name - attachment name (optional)Source
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||