public class SendMail extends AbstractSendMail
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_MAIL_ENCODING |
static long |
emailFailed |
static long |
emailSent |
static String |
mailEncoding |
protected static Set<String> |
RECOGNIZED_HEADERS |
protected javax.mail.Session |
session |
configurationPath, getMaintainerFunction, getVersionFunction, properties, STATE_START_TIMEdescription, guiName, namefunctions, getFunctions| Modifier and Type | Method and Description |
|---|---|
protected javax.mail.internet.MimeMessage |
constructMessage(String from,
javax.mail.internet.InternetAddress[] to,
Map<String,String> headers)
Utility method to do the generic job of creating a MimeMessage object and setting its recipients and 'from'.
|
protected Set<String> |
getDomains()
Returns the domains that are te be consided 'local' domains.
|
String |
getModuleInfo()
Provide some info on the module;
By default, this returns the module description for the default locale
|
javax.mail.Session |
getSession() |
String |
getTypeField() |
void |
init()
Initializes the module.
|
protected boolean |
isLocal(javax.mail.internet.InternetAddress recipient) |
protected javax.mail.internet.InternetAddress[] |
parseOnly(String to)
Like InternetAddress#parse but leaves out the addresses not matching 'onlyTo'.
|
void |
reload()
This method should be called when the module should be reloaded.
|
void |
sendLocalMail(javax.mail.internet.InternetAddress[] to,
Node n)
Delivers the mail represented by an MMBase node 'locally'.
|
boolean |
sendMail(Node n)
Send mail with headers AND attachments
|
boolean |
sendMail(String onlyto,
Node n)
Send mail with headers AND attachments to the emailaddresses
specified in the 'to' and 'cc' fields.
|
boolean |
sendMail(String from,
String to,
String data,
Map<String,String> headers)
Send mail with headers, withouth using any explicit nodes.
|
boolean |
sendMultiPartMail(String from,
String to,
Map<String,String> headers,
javax.mail.internet.MimeMultipart mmpart)
Sends a 'multipart' mail.
|
protected void |
sendRemoteMail(javax.mail.internet.InternetAddress[] onlyto,
javax.mail.Address sender,
Node n)
Sends an email which is represented by an MMBase node.
|
protected void |
sendRemoteMail(javax.mail.internet.InternetAddress[] onlyto,
Node n) |
sendMail, sendMailonloadreloadConfiguration, reloadConfigurationaddInitParameters, getInitParameter, getInitParameter, getInitParameter, getInitParameters, getInitParameters, getMaintainer, getModule, getModule, getModule, getModule, getModuleLoader, getModuleReader, getModuleReader, getModules, getState, getStates, getVersion, hasModule, hasStarted, loadInitParameters, loadInitParameters, maintainance, setInitParameter, setMaintainer, setState, setVersion, shutdown, shutdownModules, startModule, startModulesgetDefaultLocale, getDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUIName, setLocalizedDescription, setLocalizedGUIName, setNameaddFunction, createParameters, getFunction, getFunctions, getFunctionValue, newFunctionInstancepublic static final String DEFAULT_MAIL_ENCODING
public static String mailEncoding
public static long emailSent
public static long emailFailed
protected javax.mail.Session session
public SendMail()
public SendMail(String name)
protected Set<String> getDomains()
public void sendLocalMail(javax.mail.internet.InternetAddress[] to,
Node n)
protected javax.mail.internet.InternetAddress[] parseOnly(String to) throws javax.mail.MessagingException
javax.mail.MessagingExceptionpublic boolean sendMultiPartMail(String from, String to, Map<String,String> headers, javax.mail.internet.MimeMultipart mmpart) throws javax.mail.MessagingException
AbstractSendMailsendMultiPartMail in class AbstractSendMailtrue Could in principle return false on
failure. But that would normally result an exception.javax.mail.MessagingExceptionpublic String getModuleInfo()
getModuleInfo in class Modulepublic void reload()
ReloadableModulereload in class ReloadableModulepublic void init()
Module.startModule(), which makes sure it is not called
more than once. You should not call init() directly, call startModule() instead.protected final javax.mail.internet.MimeMessage constructMessage(String from, javax.mail.internet.InternetAddress[] to, Map<String,String> headers) throws javax.mail.MessagingException
javax.mail.MessagingExceptionpublic boolean sendMail(String from, String to, String data, Map<String,String> headers)
sendMail in class AbstractSendMailprotected void sendRemoteMail(javax.mail.internet.InternetAddress[] onlyto,
Node n)
protected void sendRemoteMail(javax.mail.internet.InternetAddress[] onlyto,
javax.mail.Address sender,
Node n)
sender - If this is a forward, then you'd want to set the sender to the local address
(see rfc 822 4.4.4)public boolean sendMail(Node n)
protected boolean isLocal(javax.mail.internet.InternetAddress recipient)
public boolean sendMail(String onlyto, Node n)
public javax.mail.Session getSession()
public String getTypeField()
MMBase 1.9-SNAPSHOT - ${javadoctimestamp}