Package de.uplanet.lucy.server.mail
Class GroovyMailBuilderWrapper
java.lang.Object
de.uplanet.lucy.server.mail.GroovyMailBuilderWrapper
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add aBcc
recipient address.void
Add aCc
recipient address.void
Add a mail header.void
addReplyTo
(Object p_address) Add aReply-To
address.void
Add aTo
recipient address.void
attachFile
(Object p_obj, String p_strContentType, String p_strName) Attach a file to this message.void
attachFile
(Map<String, Object> p_namedArgs) Attach a file to this message.void
attachFileRelated
(Object p_obj, String p_strContentType, String p_strName, String p_strContentId) Attach a file to this message.void
attachFileRelated
(Map<String, Object> p_namedArgs) Attach a file to this message.drop()
Drop the mail as a file in the pickup folder.de.uplanet.lucy.server.mail.GroovyMailBuilderWrapper.BodyWrapper
getBody()
Get the mail body object.Get the content type of this mail.Set the (temporary) output directory for mail drop operations.Get the pickup directory for mail drop operations.Get the subject.boolean
This flag indicates if mail sending (@link #drop() drop}
) should be part of the current transaction if one exists.void
void
send
(javax.mail.Session p_session) void
Set one or moreBcc
recipient sddresses.void
setBody
(CharSequence p_chseq) Set the mail body as text.void
Set one or moreCc
recipient sddresses.void
setContentType
(String p_strContentType) Set the content type of this mail.void
setDirOutput
(File p_dirOutput) Set the (temporary) output directory for mail drop operations.void
setDirPickup
(File p_dirPickup) Set the pickup directory for mail drop operations.void
Set theFrom
address.void
setHeaders
(Map<String, String> p_headers) Add the mail headers from the given map.void
setReplyTo
(Object p_addresses) Set one or moreReply-To
sddresses.void
setSubject
(String p_strSubject) Set the subject.void
Set one or moreTo
recipient sddresses.void
setUseTransaction
(boolean p_bUseTransaction) This flag indicates if mail sending (@link #drop() drop}
) should be part of the current transaction if one exists.srcInlineImage
(Object p_obj) Add an inline image to this message.srcInlineImage
(Object p_obj, String p_strContentType) Add an inline image to this message.
-
Method Details
-
setUseTransaction
public void setUseTransaction(boolean p_bUseTransaction) This flag indicates if mail sending (@link #drop() drop}
) should be part of the current transaction if one exists.Normally this is
true
by default.- Parameters:
p_bUseTransaction
-true
if a transaction should be used, orfalse
otherwise.
-
isUseTransaction
public boolean isUseTransaction()This flag indicates if mail sending (@link #drop() drop}
) should be part of the current transaction if one exists.Normally this is
true
by default.- Returns:
true
if a transaction should be used, orfalse
otherwise.
-
getDirOutput
Set the (temporary) output directory for mail drop operations.This directory should reside on the same physical device as the
output directory
.- Returns:
- The output directory.
-
setDirOutput
Set the (temporary) output directory for mail drop operations.This directory should reside on the same physical device as the
pickup directory
.- Parameters:
p_dirOutput
- The output directory.
-
getDirPickup
Get the pickup directory for mail drop operations.This directory should reside on the same physical device as the
output directory
.- Returns:
- The pickup directory.
-
setDirPickup
Set the pickup directory for mail drop operations.This directory should reside on the same physical device as the
output directory
.- Parameters:
p_dirPickup
- The pickup directory.
-
setHeaders
Add the mail headers from the given map.- Parameters:
p_headers
- A map that contains the mail headers to be added.
-
addHeader
Add a mail header.- Parameters:
p_strName
- The header name.p_strValue
- The header value.
-
setFrom
Set theFrom
address.- Parameters:
p_address
- A character sequence, or aInternetAddress
.
-
setTo
Set one or moreTo
recipient sddresses.- Parameters:
p_addresses
- An address, or a collection of addresses.- Adresses can be character sequences (strings), or of the type
InternetAddress
. - Address collections can be of the type
Collection
, or one of its subtypes such as lists, or sets. Arrays are also supported. The contained elements must be of the same types as single addresses.
- Adresses can be character sequences (strings), or of the type
-
addTo
Add aTo
recipient address.- Parameters:
p_address
- A character sequence, or aInternetAddress
.
-
setCc
Set one or moreCc
recipient sddresses.- Parameters:
p_addresses
- An address, or a collection of addresses.- Adresses can be character sequences (strings), or of the type
InternetAddress
. - Address collections can be of the type
Collection
, or one of its subtypes such as lists, or sets. Arrays are also supported. The contained elements must be of the same types as single addresses.
- Adresses can be character sequences (strings), or of the type
-
addCc
Add aCc
recipient address.- Parameters:
p_address
- A character sequence, or aInternetAddress
.
-
setBcc
Set one or moreBcc
recipient sddresses.- Parameters:
p_addresses
- An address, or a collection of addresses.- Adresses can be character sequences (strings), or of the type
InternetAddress
. - Address collections can be of the type
Collection
, or one of its subtypes such as lists, or sets. Arrays are also supported. The contained elements must be of the same types as single addresses.
- Adresses can be character sequences (strings), or of the type
-
addBcc
Add aBcc
recipient address.- Parameters:
p_address
- A character sequence, or aInternetAddress
.
-
setReplyTo
Set one or moreReply-To
sddresses.- Parameters:
p_addresses
- An address, or a collection of addresses.- Adresses can be character sequences (strings), or of the type
InternetAddress
. - Address collections can be of the type
Collection
, or one of its subtypes such as lists, or sets. Arrays are also supported. The contained elements must be of the same types as single addresses.
- Adresses can be character sequences (strings), or of the type
-
addReplyTo
Add aReply-To
address.- Parameters:
p_address
- A character sequence, or aInternetAddress
.
-
getSubject
Get the subject.- Returns:
- The subject.
-
setSubject
Set the subject.- Parameters:
p_strSubject
- The subject.
-
getBody
public de.uplanet.lucy.server.mail.GroovyMailBuilderWrapper.BodyWrapper getBody()Get the mail body object.- Returns:
- The mail body object.
-
setBody
Set the mail body as text.- Parameters:
p_chseq
- The mail body content as text.
-
getContentType
Get the content type of this mail.Default is
text/plain
.- Returns:
- The content type.
-
setContentType
Set the content type of this mail.Default is
text/plain
.- Parameters:
p_strContentType
- The content type.
-
attachFile
Attach a file to this message.Parameters are
file
: the file to be attached, as a file object, or path (required)contentType
: the content type of the file (required)name
: the attachment's file name; if omitted, the name offile
will be used
- Parameters:
p_namedArgs
- The named parameters.
-
attachFile
Attach a file to this message.- Parameters:
p_obj
- The file as a file object, or path.p_strContentType
- The content type.p_strName
- The attachment's file name.
-
attachFileRelated
Attach a file to this message. This method is primarily used to attach inline images of HTML mails.Parameters are
file
: the file to be attached, as a file object, or path (required)contentType
: the content type of the file (required)name
: the attachment's file name; if omitted, the name offile
will be usedcontentId
: the attachment'sContent-ID
- Parameters:
p_namedArgs
- The named parameters.
-
attachFileRelated
public void attachFileRelated(Object p_obj, String p_strContentType, String p_strName, String p_strContentId) Attach a file to this message.- Parameters:
p_obj
- The file as a file object, or path.p_strContentType
- The content type.p_strName
- The attachment's file name.p_strContentId
- The attachment'sContent-ID
.
-
srcInlineImage
Add an inline image to this message.The content type is derived from the extension of the given file. Supported extensions are
.png
,.jpg
,.jpeg
,.jpe
,.gif
,.tif
,.tiff
, and.bmp
.- Parameters:
p_obj
- The inline image as a file object, or path.- Returns:
- The generated
Content-ID
of the file.
-
srcInlineImage
Add an inline image to this message.- Parameters:
p_obj
- The inline image as a file object, or path.p_strContentType
- The content type of the image.- Returns:
- The generated
Content-ID
of the file.
-
drop
Drop the mail as a file in the pickup folder.- Returns:
- The dropped file.
- Throws:
javax.mail.MessagingException
IOException
-
send
- Throws:
javax.mail.MessagingException
IOException
-
send
- Throws:
javax.mail.MessagingException
IOException
-