|
Keel 2.1RC2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.keel.services.mail.javamail.DefaultMailer
This service implements the Keel Mailer service. It provides the capability to send email via an SMTP server. This service supports both a standard and an authenticated SMTP session. The typical configuration for this service is as follows:
mail.attbi.com
true
username>
password
true
myuser@myhost.com
[EMPTY SUBJECT]
| Field Summary | |
private java.lang.String[] |
attachmentsName of file(s) for MIME attachment(s) |
private InternetAddress[] |
bccAddressAddress(es) to send blind-carbon-copy to |
private InternetAddress[] |
ccAddressAddress(es) to send carbon-copy to |
private Configuration |
configurationThe configuraton for this service - from mailer-system.xconf |
private java.lang.String |
defaultFromFrom address to use, if none provided |
private java.lang.String |
defaultSubject |
private InternetAddress |
fromAddressSender's address |
private java.util.Vector |
headersHeaders to add |
private Logger |
loggerThe logger for info/debug messages |
private boolean |
mailAuthSMTP server requires authentication |
private boolean |
mailDebugTurn on JavaMail session debug |
private java.lang.String |
mailHostThe SMTP host |
private java.lang.String |
mailPasswordPassword for SMTP authentication |
private java.lang.String |
mailUserUsername for SMTP authentication |
private java.lang.String |
messageText message |
private InternetAddress[] |
replyToAddressAddress(es) to send reply to |
private java.lang.String |
subjectEmail subject |
private InternetAddress[] |
toAddressAddress(es) to send to |
| Fields inherited from interface org.keel.services.mail.Mailer |
ROLE |
| Constructor Summary | |
DefaultMailer() |
|
| Method Summary | |
void |
addMIMEAttachment(java.lang.String fileName)Add a MIME attachment, MIME-type will be determined automatically by the system |
void |
addMIMEAttachment(java.lang.String[] fileNames)Add multiple MIME attachments |
void |
configure(Configuration configuration)This method reads the container-provided configuration |
void |
enableLogging(Logger logger)This method associates this service with a logger |
void |
send()Send the email to the mail-server |
void |
send(java.lang.String host, java.lang.String user, java.lang.String password)Send mail to a different host with a different user and password |
void |
setBccAddress(java.lang.String address)Set the blind-carbon-copy addresses for this email |
void |
setBccAddress(java.lang.String[] addresses)Set multiple blibd-carbon-copy addresses |
void |
setCcAddress(java.lang.String address)Set the carbon-copy address for this email |
void |
setCcAddress(java.lang.String[] addresses)Set multiple carbon-copy addresses |
void |
setFromAddress(java.lang.String address)Set the address of the sender of the email |
void |
setHeader(java.lang.String name, java.lang.String value)Set an arbitrary header |
void |
setMessage(java.lang.String message)Set the text content of the email, weill be sent as first attachment |
void |
setReplyToAddress(java.lang.String address)Set the reply-to header in the email, usually if different from the sender's email. |
void |
setReplyToAddress(java.lang.String[] addresses)Set multiple reply-to addresses |
void |
setSubject(java.lang.String subject)Set the subject of the email |
void |
setToAddress(java.lang.String address)The address to send email |
void |
setToAddress(java.lang.String[] addresses)Set the addresses to send email to |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private Logger logger
private Configuration configuration
private java.lang.String mailHost
private boolean mailDebug
private boolean mailAuth
private java.lang.String mailUser
private java.lang.String mailPassword
private java.lang.String defaultFrom
private java.lang.String defaultSubject
private InternetAddress[] toAddress
private InternetAddress[] ccAddress
private InternetAddress[] bccAddress
private InternetAddress fromAddress
private InternetAddress[] replyToAddress
private java.util.Vector headers
private java.lang.String[] attachments
private java.lang.String subject
private java.lang.String message
| Constructor Detail |
public DefaultMailer()
| Method Detail |
public void addMIMEAttachment(java.lang.String fileName)
throws NestedException
MaileraddMIMEAttachment in interface MailerfileName -NestedExceptionMailer.addMIMEAttachment(java.lang.String)
public void addMIMEAttachment(java.lang.String[] fileNames)
throws NestedException
MaileraddMIMEAttachment in interface MailerfileNames -NestedExceptionorg.keel.services.mail.Mailer#addMIMEAttachmentList(java.util.Vector)
public void send()
throws NestedException
Mailersend in interface MailerNestedException
public void send(java.lang.String host,
java.lang.String user,
java.lang.String password)
throws NestedException
Mailersend in interface Mailerhost -user -password -NestedExceptionMailer.send()
public void setBccAddress(java.lang.String address)
throws NestedException
MailersetBccAddress in interface Maileraddress -NestedExceptionMailer.setBccAddress(java.lang.String)
public void setBccAddress(java.lang.String[] addresses)
throws NestedException
MailersetBccAddress in interface Maileraddresses -NestedExceptionorg.keel.services.mail.Mailer#setBccAddressList(java.util.Vector)
public void setCcAddress(java.lang.String address)
throws NestedException
MailersetCcAddress in interface Maileraddress -NestedExceptionMailer.setCcAddress(java.lang.String)
public void setCcAddress(java.lang.String[] addresses)
throws NestedException
MailersetCcAddress in interface Maileraddresses -NestedExceptionorg.keel.services.mail.Mailer#setCcAddressList(java.util.Vector)
public void setFromAddress(java.lang.String address)
throws NestedException
MailersetFromAddress in interface Maileraddress -NestedExceptionMailer.setFromAddress(java.lang.String)
public void setReplyToAddress(java.lang.String address)
throws NestedException
MailersetReplyToAddress in interface Maileraddress -NestedExceptionMailer.setReplyToAddress(java.lang.String)
public void setReplyToAddress(java.lang.String[] addresses)
throws NestedException
MailersetReplyToAddress in interface Maileraddresses -NestedExceptionMailer.setReplyToAddress(java.lang.String)
public void setMessage(java.lang.String message)
throws NestedException
MailersetMessage in interface Mailermessage -NestedExceptionMailer.setMessage(java.lang.String)
public void setSubject(java.lang.String subject)
throws NestedException
MailersetSubject in interface Mailersubject -NestedExceptionMailer.setSubject(java.lang.String)
public void setToAddress(java.lang.String address)
throws NestedException
MailersetToAddress in interface Maileraddress - A standard address, or a comma-separated list of addressesNestedExceptionMailer.setToAddress(java.lang.String)
public void setToAddress(java.lang.String[] addresses)
throws NestedException
MailersetToAddress in interface Maileraddresses - An array of String addressesNestedExceptionorg.keel.services.mail.Mailer#setToAddressList(java.util.Vector)
public void configure(Configuration configuration)
throws ConfigurationException
configure in interface Configurableconfiguration - the class configurations. Must not be null.ConfigurationException - if an error occursConfigurable.configure(org.apache.avalon.framework.configuration.Configuration)public void enableLogging(Logger logger)
enableLogging in interface LogEnabledlogger - the logger. Must not be null.LogEnabled.enableLogging(org.apache.avalon.framework.logger.Logger)
public void setHeader(java.lang.String name,
java.lang.String value)
throws NestedException
MailersetHeader in interface Mailername -value -NestedExceptionorg.keel.services.mail.Mailer#Header(java.lang.String, java.lang.String)
|
Keel 2.1RC2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||