Package overit.geocall.mail
Class Email
java.lang.Object
overit.geocall.mail.Email
Class that manages the Email object with its relative attachments and properties
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Authenticatorprotected Stringprotected Stringprotected static booleanprotected Identityprotected MimeMessageprotected Sessionprotected XMLTree -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidaddAttachment(String resource) Add a new attachment to the emailvoidSets the "bcc" of the emailvoidSets the "cc" of the emailvoidSets the "to" of the emailprotected DBViewgetAddresses(String type) Returns theDBViewof the attachmentsgetBccs()Returns theDBViewof the "bcc"s of the emailgetBody()Returns the string containing the body of the emailgetCcs()Returns theDBViewof the "cc"s of the emailgetError()Returns a string containing the name of the resources that cannot be attachedgetFrom()Returns the Getter with the fromintReturns the priority of the emailReturns the subject of the emailgetTos()Returns theDBViewof the "to"s of the emailgetXML()Returns theXMLTreeprotected voidremoveAddress(String type, String address, String name) voidremoveAttachment(String res) Revome an attachment to the emailvoidRemove the "bcc" of the emailvoidRemove the "cc" of the emailvoidRemove the "to" of the emailvoidsend()Send the emailvoidsend(SmtpServer ss) Send the emailvoidsetAuthenticator(Authenticator authenticator) Sets the authenticatorvoidSets the body of the emailvoidSets the content typevoidSets the "from" of the emailvoidsetPriority(int p) Sets the priority of the emailvoidsetSubject(String s) Sets the subject of the emailvoidWrite the email in a file
-
Field Details
-
_identity
-
_session
-
_message
-
_xml
-
_contentType
-
_bodyCharset
-
_authenticator
-
_debug
protected static boolean _debug
-
-
Constructor Details
-
Method Details
-
setContentType
Sets the content type- Parameters:
s- String containing the content type to set
-
setAuthenticator
Sets the authenticator- Parameters:
authenticator- TheAuthenticatorto set
-
setSubject
Sets the subject of the email- Parameters:
s- String containing the subject of the email
-
setPriority
public void setPriority(int p) Sets the priority of the email- Parameters:
p- The priority
-
setFrom
Sets the "from" of the email- Parameters:
address- The addressname- The name
-
addTo
Sets the "to" of the email- Parameters:
address- The addressname- The name
-
addCc
Sets the "cc" of the email- Parameters:
address- The addressname- The name
-
addBcc
Sets the "bcc" of the email- Parameters:
address- The addressname- The name
-
removeAddress
-
removeTo
Remove the "to" of the email- Parameters:
address- The addressname- The name
-
removeCc
Remove the "cc" of the email- Parameters:
address- The addressname- The name
-
removeBcc
Remove the "bcc" of the email- Parameters:
address- The addressname- The name
-
setBody
Sets the body of the email- Parameters:
text- The text
-
addAttachment
Add a new attachment to the email- Parameters:
resource- String containing the resource to add
-
removeAttachment
Revome an attachment to the email- Parameters:
res- String containing the resource to remove
-
getAttachments
Returns theDBViewof the attachments- Returns:
- The
DBViewof the attachments
-
getAddresses
-
getTos
Returns theDBViewof the "to"s of the email- Returns:
- The
DBViewof the "to"s of the email
-
getCcs
Returns theDBViewof the "cc"s of the email- Returns:
- The
DBViewof the "cc"s of the email
-
getBccs
Returns theDBViewof the "bcc"s of the email- Returns:
- The
DBViewof the "bcc"s of the email
-
getFrom
Returns the Getter with the from- Returns:
- The Getter with the from
-
getSubject
Returns the subject of the email- Returns:
- The subject of the email
-
getPriority
public int getPriority()Returns the priority of the email- Returns:
- The priority of the email
-
getBody
Returns the string containing the body of the email- Returns:
- The string containing the body of the email
-
getXML
Returns theXMLTree- Returns:
- The
XMLTree
-
send
Send the email- Throws:
EmailException- if an error occurs sending the email
-
send
Send the email- Parameters:
ss- The SmtpServer- Throws:
EmailException- if an error occurs sending the email
-
writeTo
Write the email in a file- Parameters:
s- The name of the file- Throws:
IOException- if an I/O exception occursEmailException- if an error occurs sending the email
-
getError
Returns a string containing the name of the resources that cannot be attached- Returns:
- A string containing the name of the resources that cannot be attached
-
_construct
- Throws:
MessagingException
-