Package de.uplanet.lucy.server.mail
Class GroovyMailBuilderWrapper
java.lang.Object
de.uplanet.lucy.server.mail.GroovyMailBuilderWrapper
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdd aBccrecipient address.voidAdd aCcrecipient address.voidAdd a mail header.voidaddReplyTo(Object p_address) Add aReply-Toaddress.voidAdd aTorecipient address.voidattachFile(Object p_obj, String p_strContentType, String p_strName) Attach a file to this message.voidattachFile(Map<String, Object> p_namedArgs) Attach a file to this message.voidattachFileRelated(Object p_obj, String p_strContentType, String p_strName, String p_strContentId) Attach a file to this message.voidattachFileRelated(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.BodyWrappergetBody()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.booleanThis flag indicates if mail sending (@link #drop() drop}) should be part of the current transaction if one exists.voidvoidsend(javax.mail.Session p_session) voidSet one or moreBccrecipient sddresses.voidsetBody(CharSequence p_chseq) Set the mail body as text.voidSet one or moreCcrecipient sddresses.voidsetContentType(String p_strContentType) Set the content type of this mail.voidsetDirOutput(File p_dirOutput) Set the (temporary) output directory for mail drop operations.voidsetDirPickup(File p_dirPickup) Set the pickup directory for mail drop operations.voidSet theFromaddress.voidsetHeaders(Map<String, String> p_headers) Add the mail headers from the given map.voidsetReplyTo(Object p_addresses) Set one or moreReply-Tosddresses.voidsetSubject(String p_strSubject) Set the subject.voidSet one or moreTorecipient sddresses.voidsetUseTransaction(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
trueby default.- Parameters:
p_bUseTransaction-trueif a transaction should be used, orfalseotherwise.
-
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
trueby default.- Returns:
trueif a transaction should be used, orfalseotherwise.
-
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 theFromaddress.- Parameters:
p_address- A character sequence, or aInternetAddress.
-
setTo
Set one or moreTorecipient 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 aTorecipient address.- Parameters:
p_address- A character sequence, or aInternetAddress.
-
setCc
Set one or moreCcrecipient 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 aCcrecipient address.- Parameters:
p_address- A character sequence, or aInternetAddress.
-
setBcc
Set one or moreBccrecipient 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 aBccrecipient address.- Parameters:
p_address- A character sequence, or aInternetAddress.
-
setReplyTo
Set one or moreReply-Tosddresses.- 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-Toaddress.- 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 offilewill 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 offilewill 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-IDof 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-IDof the file.
-
drop
Drop the mail as a file in the pickup folder.- Returns:
- The dropped file.
- Throws:
javax.mail.MessagingExceptionIOException
-
send
- Throws:
javax.mail.MessagingExceptionIOException
-
send
- Throws:
javax.mail.MessagingExceptionIOException
-