public final class SendMail
extends java.lang.Object
Constructor and Description |
---|
SendMail() |
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args)
Read properties from a file and send mail according to them
|
static java.util.ArrayList |
send(MailAccount oMacc,
java.util.Properties oSessionProps,
java.lang.String sUserDir,
java.lang.String sTextHtml,
java.lang.String sTextPlain,
java.lang.String sEncoding,
java.lang.String[] aAttachments,
java.lang.String sSubject,
java.lang.String sFromAddr,
java.lang.String sFromPersonal,
java.lang.String sReplyAddr,
java.lang.String[] aRecipients,
java.lang.String sRecipientType,
java.lang.String sId,
java.lang.String sEnvCnfFileName,
java.lang.String sJobTl,
boolean bAutoRunJob,
java.util.Date dtExecution,
DBBind oGlobalDbb)
Send an e-mail to a recipients list
The message may be sent inmediately by the current thread or asynchronously at the designated date.
|
static java.util.ArrayList |
send(MailAccount oMacc,
java.util.Properties oSessionProps,
java.lang.String sUserDir,
java.lang.String sTextHtml,
java.lang.String sTextPlain,
java.lang.String sEncoding,
java.lang.String[] aAttachments,
java.lang.String sSubject,
java.lang.String sFromAddr,
java.lang.String sFromPersonal,
java.lang.String sReplyAddr,
java.lang.String[] aRecipients,
java.lang.String sRecipientType,
java.lang.String sId,
java.lang.String sEnvCnfFileName,
java.lang.String sJobTl,
boolean bAutoRunJob,
DBBind oGlobalDbb)
Send an e-mail to a recipients list
The message may be sent inmediately by the current thread or asynchronously as soon as possible.
|
static java.util.ArrayList |
send(java.util.Properties oSessionProps,
java.lang.String sUserDir,
java.lang.String sTextHtml,
java.lang.String sTextPlain,
java.lang.String sEncoding,
java.lang.String[] aAttachments,
java.lang.String sSubject,
java.lang.String sFromAddr,
java.lang.String sFromPersonal,
java.lang.String sReplyAddr,
java.lang.String[] aRecipientsTo,
java.lang.String[] aRecipientsCc,
java.lang.String[] aRecipientsBcc,
java.lang.String sId) |
static java.util.ArrayList |
send(java.util.Properties oSessionProps,
java.lang.String sUserDir,
java.lang.String sTextHtml,
java.lang.String sTextPlain,
java.lang.String sEncoding,
java.lang.String[] aAttachments,
java.lang.String sSubject,
java.lang.String sFromAddr,
java.lang.String sFromPersonal,
java.lang.String sReplyAddr,
java.lang.String[] aRecipients,
java.lang.String sRecipientType,
java.lang.String sId,
java.lang.String sEnvCnfFileName,
java.lang.String sJobTl) |
static java.util.ArrayList |
send(java.util.Properties oSessionProps,
java.lang.String sUserDir,
java.lang.String sTextHtml,
java.lang.String sTextPlain,
java.lang.String sEncoding,
java.lang.String[] aAttachments,
java.lang.String sSubject,
java.lang.String sFromAddr,
java.lang.String sFromPersonal,
java.lang.String sReplyAddr,
java.lang.String[] aRecipients,
java.lang.String sRecipientType,
java.lang.String sId,
java.lang.String sEnvCnfFileName,
java.lang.String sJobTl,
DBBind oGlobalDbb)
Send an e-mail to a recipients list
The message may be sent inmediately by the current thread or
asynchronously by a new instance of com.knowgate.scheduler.SingleThreadExecutor
that will be created on the fly.
|
static java.util.ArrayList |
send(java.util.Properties oSessionProps,
java.lang.String sTextPlain,
java.lang.String sSubject,
java.lang.String sFromAddr,
java.lang.String sFromPersonal,
java.lang.String sReplyAddr,
java.lang.String[] aRecipients)
Send a plain text message to a given recipients list
The message will be sent inmediately indipendently to each recipient
|
static java.util.ArrayList |
send(java.util.Properties oSessionProps,
java.lang.String sTextHtml,
java.lang.String sTextPlain,
java.lang.String sSubject,
java.lang.String sFromAddr,
java.lang.String sFromPersonal,
java.lang.String sReplyAddr,
java.lang.String[] aRecipients)
Send a dual plain text and HTML message to a given recipients list
The message will be sent inmediately independently to each recipient
|
static java.util.ArrayList |
send(java.util.Properties oSessionProps,
java.lang.String sTextHtml,
java.lang.String sTextPlain,
java.lang.String sEncoding,
java.lang.String sSubject,
java.lang.String sFromAddr,
java.lang.String sFromPersonal,
java.lang.String sReplyAddr,
java.lang.String[] aRecipients)
Send a dual plain text and HTML message to a given recipients list
The message will be sent inmediately indipendently to each recipient
|
public static java.util.ArrayList send(MailAccount oMacc, java.util.Properties oSessionProps, java.lang.String sUserDir, java.lang.String sTextHtml, java.lang.String sTextPlain, java.lang.String sEncoding, java.lang.String[] aAttachments, java.lang.String sSubject, java.lang.String sFromAddr, java.lang.String sFromPersonal, java.lang.String sReplyAddr, java.lang.String[] aRecipients, java.lang.String sRecipientType, java.lang.String sId, java.lang.String sEnvCnfFileName, java.lang.String sJobTl, boolean bAutoRunJob, java.util.Date dtExecution, DBBind oGlobalDbb) throws java.io.FileNotFoundException, java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalAccessException, java.lang.NullPointerException, javax.mail.MessagingException, com.enterprisedt.net.ftp.FTPException, java.sql.SQLException, java.lang.ClassNotFoundException, java.lang.InstantiationException
Send an e-mail to a recipients list
The message may be sent inmediately by the current thread or asynchronously at the designated date. If parameter sJobTl is null then the message will be send by the current thread. If sJobTl is not null then a new job will be inserted at k_jobs table. A new SingleThreadExecutor will be created if bAutoRunJob parameter is true or if bAutoRunJob is false then the new Job will remain in Pending status until the main Job Scheduler starts running it.oMacc
- MailAccount used for sending the messageoSessionProps
- Properties
Property | Description> | Default value |
---|---|---|
mail.user | Store and transport user | |
mail.password | Store and transport password | |
mail.store.protocol | pop3 | |
mail.transport.protocol | smtp | |
mail.storeprotocol.host | For example: pop.mailserver.com | |
mail.storeprotocol.socketFactory.class | Only if using SSL set this value to javax.net.ssl.SSLSocketFactory | |
mail.storeprotocol.socketFactory.port | Only if using SSL | |
mail.transportprotocol.host | For example: smtp.mailserver.com | |
mail.transportprotocol.socketFactory.class | Only if using SSL set this value to javax.net.ssl.SSLSocketFactory | |
mail.transportprotocol.socketFactory.port | Only if using SSL |
sUserDir
- Full path of base directory for mail inline and attached filessTextHtml
- HTML message part, if null then mail body is just plain textsTextPlain
- Plain text message part, if null then mail body is HTML onlysEncoding
- Character encoding, see http://java.sun.com/j2se/1.3/docs/guide/intl/encoding.doc.htmlaAttachments
- Array of attachments file names, without path, they must be under sUserDir base directorysSubject
- Message subjectsFromAddr
- Recipient From addresssFromPersonal
- Recipient From Display NamesReplyAddr
- Reply-To addressaRecipients
- List of recipient addressessRecipientType
- Recipients Type. Must be of one {to, cc, bcc}sId
- Job or Message GUID If null then an automatically generated 32 characters GUID is assignedsEnvCnfFileName
- Name without extension of properties file to be used for conenction to the database.
This parameter is optional and only required when the message must be send by the job schedulersJobTl
- Job Title. This parameter is optional and only required when the message must be send by the job schedulerbAutoRunJob
- boolean, whether or not a thread must be automatically started for running the Job inmediately.dtExecution
- Date when job must be executed or null if job is in auto run mode or must be executed as soon as possible.oGlobalDbb
- DBBind instance used for accesing the database, if null a new one is created if it is requiredjava.io.FileNotFoundException
java.io.IOException
java.lang.IllegalArgumentException
java.lang.IllegalAccessException
java.lang.NullPointerException
javax.mail.MessagingException
com.enterprisedt.net.ftp.FTPException
java.sql.SQLException
java.lang.ClassNotFoundException
java.lang.InstantiationException
public static java.util.ArrayList send(MailAccount oMacc, java.util.Properties oSessionProps, java.lang.String sUserDir, java.lang.String sTextHtml, java.lang.String sTextPlain, java.lang.String sEncoding, java.lang.String[] aAttachments, java.lang.String sSubject, java.lang.String sFromAddr, java.lang.String sFromPersonal, java.lang.String sReplyAddr, java.lang.String[] aRecipients, java.lang.String sRecipientType, java.lang.String sId, java.lang.String sEnvCnfFileName, java.lang.String sJobTl, boolean bAutoRunJob, DBBind oGlobalDbb) throws java.io.FileNotFoundException, java.io.IOException, java.lang.IllegalAccessException, java.lang.NullPointerException, javax.mail.MessagingException, com.enterprisedt.net.ftp.FTPException, java.sql.SQLException, java.lang.ClassNotFoundException, java.lang.InstantiationException
Send an e-mail to a recipients list
The message may be sent inmediately by the current thread or asynchronously as soon as possible. If parameter sJobTl is null then the message will be send by the current thread. If sJobTl is not null then a new job will be inserted at k_jobs table. A new SingleThreadExecutor will be created if bAutoRunJob parameter is true or if bAutoRunJob is false then the new Job will remain in Pending status until the main Job Scheduler starts running it.oMacc
- MailAccount used for sending the messageoSessionProps
- Properties
Property | Description> | Default value |
---|---|---|
mail.user | Store and transport user | |
mail.password | Store and transport password | |
mail.store.protocol | pop3 | |
mail.transport.protocol | smtp | |
mail.storeprotocol.host | For example: pop.mailserver.com | |
mail.storeprotocol.socketFactory.class | Only if using SSL set this value to javax.net.ssl.SSLSocketFactory | |
mail.storeprotocol.socketFactory.port | Only if using SSL | |
mail.transportprotocol.host | For example: smtp.mailserver.com | |
mail.transportprotocol.socketFactory.class | Only if using SSL set this value to javax.net.ssl.SSLSocketFactory | |
mail.transportprotocol.socketFactory.port | Only if using SSL |
sUserDir
- Full path of base directory for mail inline and attached filessTextHtml
- HTML message part, if null then mail body is just plain textsTextPlain
- Plain text message part, if null then mail body is HTML onlysEncoding
- Character encoding, see http://java.sun.com/j2se/1.3/docs/guide/intl/encoding.doc.htmlaAttachments
- Array of attachments file names, without path, they must be under sUserDir base directorysSubject
- Message subjectsFromAddr
- Recipient From addresssFromPersonal
- Recipient From Display NamesReplyAddr
- Reply-To addressaRecipients
- List of recipient addressessRecipientType
- Recipients Type. Must be of one {to, cc, bcc}sId
- Job or Message GUID If null then an automatically generated 32 characters GUID is assignedsEnvCnfFileName
- Name without extension of properties file to be used for conenction to the database.
This parameter is optional and only required when the message must be send by the job schedulersJobTl
- Job Title. This parameter is optional and only required when the message must be send by the job schedulerbAutoRunJob
- boolean, whether or not a thread must be automatically started for running the Job inmediately.oGlobalDbb
- DBBind instance used for accesing the database, if null a new one is created if it is requiredjava.io.FileNotFoundException
java.io.IOException
java.lang.IllegalAccessException
java.lang.NullPointerException
javax.mail.MessagingException
com.enterprisedt.net.ftp.FTPException
java.sql.SQLException
java.lang.ClassNotFoundException
java.lang.InstantiationException
public static java.util.ArrayList send(java.util.Properties oSessionProps, java.lang.String sUserDir, java.lang.String sTextHtml, java.lang.String sTextPlain, java.lang.String sEncoding, java.lang.String[] aAttachments, java.lang.String sSubject, java.lang.String sFromAddr, java.lang.String sFromPersonal, java.lang.String sReplyAddr, java.lang.String[] aRecipients, java.lang.String sRecipientType, java.lang.String sId, java.lang.String sEnvCnfFileName, java.lang.String sJobTl, DBBind oGlobalDbb) throws java.io.FileNotFoundException, java.io.IOException, java.lang.IllegalAccessException, java.lang.NullPointerException, javax.mail.MessagingException, com.enterprisedt.net.ftp.FTPException, java.sql.SQLException, java.lang.ClassNotFoundException, java.lang.InstantiationException
Send an e-mail to a recipients list
The message may be sent inmediately by the current thread or asynchronously by a new instance of com.knowgate.scheduler.SingleThreadExecutor that will be created on the fly. If parameter sJobTl is null then the message will be send by the current thread. If sJobTl is not null then a new job will be inserted at k_jobs table and a new SingleThreadExecutor will be started to execute it.oSessionProps
- Properties
Property | Description> | Default value |
---|---|---|
mail.user | Store and transport user | |
mail.password | Store and transport password | |
mail.store.protocol | pop3 | |
mail.transport.protocol | smtp | |
mail.storeprotocol.host | For example: pop.mailserver.com | |
mail.storeprotocol.socketFactory.class | Only if using SSL set this value to javax.net.ssl.SSLSocketFactory | |
mail.storeprotocol.socketFactory.port | Only if using SSL | |
mail.transportprotocol.host | For example: smtp.mailserver.com | |
mail.transportprotocol.socketFactory.class | Only if using SSL set this value to javax.net.ssl.SSLSocketFactory | |
mail.transportprotocol.socketFactory.port | Only if using SSL |
sUserDir
- Full path of base directory for mail inline and attached filessTextHtml
- HTML message part, if null then mail body is just plain textsTextPlain
- Plain text message part, if null then mail body is HTML onlysEncoding
- Character encoding, see http://java.sun.com/j2se/1.3/docs/guide/intl/encoding.doc.htmlaAttachments
- Array of attachments file names, without path, they must be under sUserDir base directorysSubject
- Message subjectsFromAddr
- Recipient From addresssFromPersonal
- Recipient From Display NamesReplyAddr
- Reply-To addressaRecipients
- List of recipient addressessRecipientType
- Recipients Type. Must be of one {to, cc, bcc}sId
- Job or Message GUID If null then an automatically generated 32 characters GUID is assignedsEnvCnfFileName
- Name without extension of properties file to be used for conenction to the database.
This parameter is optional and only required when the message must be send by the job schedulersJobTl
- Job Title. This parameter is optional and only required when the message must be send by the job scheduleroGlobalDbb
- DBBind instance used for accesing the database, if null a new one is created if it is requiredjava.io.FileNotFoundException
java.io.IOException
java.lang.IllegalAccessException
java.lang.NullPointerException
javax.mail.MessagingException
com.enterprisedt.net.ftp.FTPException
java.sql.SQLException
java.lang.ClassNotFoundException
java.lang.InstantiationException
public static java.util.ArrayList send(java.util.Properties oSessionProps, java.lang.String sUserDir, java.lang.String sTextHtml, java.lang.String sTextPlain, java.lang.String sEncoding, java.lang.String[] aAttachments, java.lang.String sSubject, java.lang.String sFromAddr, java.lang.String sFromPersonal, java.lang.String sReplyAddr, java.lang.String[] aRecipients, java.lang.String sRecipientType, java.lang.String sId, java.lang.String sEnvCnfFileName, java.lang.String sJobTl) throws java.io.FileNotFoundException, java.io.IOException, java.lang.IllegalAccessException, java.lang.NullPointerException, javax.mail.MessagingException, com.enterprisedt.net.ftp.FTPException, java.sql.SQLException, java.lang.ClassNotFoundException, java.lang.InstantiationException
java.io.FileNotFoundException
java.io.IOException
java.lang.IllegalAccessException
java.lang.NullPointerException
javax.mail.MessagingException
com.enterprisedt.net.ftp.FTPException
java.sql.SQLException
java.lang.ClassNotFoundException
java.lang.InstantiationException
public static java.util.ArrayList send(java.util.Properties oSessionProps, java.lang.String sUserDir, java.lang.String sTextHtml, java.lang.String sTextPlain, java.lang.String sEncoding, java.lang.String[] aAttachments, java.lang.String sSubject, java.lang.String sFromAddr, java.lang.String sFromPersonal, java.lang.String sReplyAddr, java.lang.String[] aRecipientsTo, java.lang.String[] aRecipientsCc, java.lang.String[] aRecipientsBcc, java.lang.String sId) throws java.io.FileNotFoundException, java.io.IOException, java.lang.IllegalAccessException, java.lang.NullPointerException, javax.mail.MessagingException, com.enterprisedt.net.ftp.FTPException, java.sql.SQLException, java.lang.ClassNotFoundException, java.lang.InstantiationException
java.io.FileNotFoundException
java.io.IOException
java.lang.IllegalAccessException
java.lang.NullPointerException
javax.mail.MessagingException
com.enterprisedt.net.ftp.FTPException
java.sql.SQLException
java.lang.ClassNotFoundException
java.lang.InstantiationException
public static java.util.ArrayList send(java.util.Properties oSessionProps, java.lang.String sTextPlain, java.lang.String sSubject, java.lang.String sFromAddr, java.lang.String sFromPersonal, java.lang.String sReplyAddr, java.lang.String[] aRecipients) throws java.io.IOException, java.lang.IllegalAccessException, java.lang.NullPointerException, javax.mail.MessagingException, java.sql.SQLException, java.lang.ClassNotFoundException, java.lang.InstantiationException
Send a plain text message to a given recipients list
The message will be sent inmediately indipendently to each recipientoSessionProps
- Properties
Property | Description> | Default value |
---|---|---|
mail.user | Store and transport user | |
mail.password | Store and transport password | |
mail.store.protocol | pop3 | |
mail.transport.protocol | smtp | |
mail.storeprotocol.host | For example: pop.mailserver.com | |
mail.storeprotocol.socketFactory.class | Only if using SSL set this value to javax.net.ssl.SSLSocketFactory | |
mail.storeprotocol.socketFactory.port | Only if using SSL | |
mail.transportprotocol.host | For example: smtp.mailserver.com | |
mail.transportprotocol.socketFactory.class | Only if using SSL set this value to javax.net.ssl.SSLSocketFactory | |
mail.transportprotocol.socketFactory.port | Only if using SSL |
sTextPlain
- Plain text message partsSubject
- Message subjectsFromAddr
- Recipient From addresssFromPersonal
- Recipient From Display NamesReplyAddr
- Reply-To addressaRecipients
- List of recipient addressesjava.io.IOException
java.lang.IllegalAccessException
java.lang.NullPointerException
javax.mail.MessagingException
java.sql.SQLException
java.lang.ClassNotFoundException
java.lang.InstantiationException
public static java.util.ArrayList send(java.util.Properties oSessionProps, java.lang.String sTextHtml, java.lang.String sTextPlain, java.lang.String sEncoding, java.lang.String sSubject, java.lang.String sFromAddr, java.lang.String sFromPersonal, java.lang.String sReplyAddr, java.lang.String[] aRecipients) throws java.io.IOException, java.lang.IllegalAccessException, java.lang.NullPointerException, javax.mail.MessagingException, java.sql.SQLException, java.lang.ClassNotFoundException, java.lang.InstantiationException
Send a dual plain text and HTML message to a given recipients list
The message will be sent inmediately indipendently to each recipientoSessionProps
- Properties
Property | Description> | Default value |
---|---|---|
mail.user | Store and transport user | |
mail.password | Store and transport password | |
mail.store.protocol | pop3 | |
mail.transport.protocol | smtp | |
mail.storeprotocol.host | For example: pop.mailserver.com | |
mail.storeprotocol.socketFactory.class | Only if using SSL set this value to javax.net.ssl.SSLSocketFactory | |
mail.storeprotocol.socketFactory.port | Only if using SSL | |
mail.transportprotocol.host | For example: smtp.mailserver.com | |
mail.transportprotocol.socketFactory.class | Only if using SSL set this value to javax.net.ssl.SSLSocketFactory | |
mail.transportprotocol.socketFactory.port | Only if using SSL |
sTextHtml
- HTML message partsTextPlain
- Plain text message partsEncoding
- Character encoding for messagesSubject
- Message subjectsFromAddr
- Recipient From addresssFromPersonal
- Recipient From Display NamesReplyAddr
- Reply-To addressaRecipients
- List of recipient addressesjava.io.IOException
java.lang.IllegalAccessException
java.lang.NullPointerException
javax.mail.MessagingException
java.sql.SQLException
java.lang.ClassNotFoundException
java.lang.InstantiationException
public static java.util.ArrayList send(java.util.Properties oSessionProps, java.lang.String sTextHtml, java.lang.String sTextPlain, java.lang.String sSubject, java.lang.String sFromAddr, java.lang.String sFromPersonal, java.lang.String sReplyAddr, java.lang.String[] aRecipients) throws java.io.IOException, java.lang.IllegalAccessException, java.lang.NullPointerException, javax.mail.MessagingException, java.sql.SQLException, java.lang.ClassNotFoundException, java.lang.InstantiationException
Send a dual plain text and HTML message to a given recipients list
The message will be sent inmediately independently to each recipientoSessionProps
- Properties
Property | Description> | Default value |
---|---|---|
mail.user | Store and transport user | |
mail.password | Store and transport password | |
mail.store.protocol | pop3 | |
mail.transport.protocol | smtp | |
mail.storeprotocol.host | For example: pop.mailserver.com | |
mail.storeprotocol.socketFactory.class | Only if using SSL set this value to javax.net.ssl.SSLSocketFactory | |
mail.storeprotocol.socketFactory.port | Only if using SSL | |
mail.transportprotocol.host | For example: smtp.mailserver.com | |
mail.transportprotocol.socketFactory.class | Only if using SSL set this value to javax.net.ssl.SSLSocketFactory | |
mail.transportprotocol.socketFactory.port | Only if using SSL |
sTextHtml
- HTML message partsTextPlain
- Plain text message partsSubject
- Message subjectsFromAddr
- Recipient From addresssFromPersonal
- Recipient From Display NamesReplyAddr
- Reply-To addressaRecipients
- List of recipient addressesjava.io.IOException
java.lang.IllegalAccessException
java.lang.NullPointerException
javax.mail.MessagingException
java.sql.SQLException
java.lang.ClassNotFoundException
java.lang.InstantiationException
public static void main(java.lang.String[] args) throws java.io.FileNotFoundException, java.io.IOException, java.lang.IllegalAccessException, java.lang.NullPointerException, javax.mail.MessagingException, com.enterprisedt.net.ftp.FTPException, java.sql.SQLException, java.lang.ClassNotFoundException, java.lang.InstantiationException, org.apache.oro.text.regex.MalformedPatternException
Read properties from a file and send mail according to them
args
- A full path to a properties filejava.io.FileNotFoundException
java.io.IOException
java.lang.IllegalAccessException
java.lang.NullPointerException
javax.mail.MessagingException
com.enterprisedt.net.ftp.FTPException
java.sql.SQLException
java.lang.ClassNotFoundException
java.lang.InstantiationException
org.apache.oro.text.regex.MalformedPatternException