EmailSender sends emails.
|Component||Data output||Input ports||Output ports||Transformation||Transf. required||Java||CTL||Auto-propagated metadata|
||For data for emails||Any|
|Output||0||For successfully sent emails.||Input 0|
|1||For rejected emails.||Input 0 plus field named |
EmailSender does not propagate metadata.
EmailSender has no metadata templates.
Metadata of the first output port are the same as those of the input port. However, metadata are not propagated from the input port to the first output port.
Metadata of the second output port have the same fields as metadata of the input port plus one field named "errorMessage". This field receives the information about the error that has occurred.
|SMTP server||yes||Name of SMTP server for outgoing emails.||e.g. smtp.example.com|
|SMTP user||Name of the user for an authenticated SMTP server.|
|SMTP password||Password of the user for an authenticated SMTP server.|
|Connection security||Specifies the security protocol used to connect to the server.||None (default) | STARTTLS | SSL|
|Message||yes||Set of properties defining the message headers and body. See Email Message for more information.|
|Attachments||Set of properties defining the message attachments. See Email Attachments for more information.|
|SMTP port||Number of the port used for connection to SMTP server.||Integers|
|Trust invalid SMTP server certificate||
By default, invalid SMTP server certificates are not accepted.
If set to ||false (default) | true|
|Ignore send fail||
By default, when an email is not successfully sent, the graph fails.
If set to
|false (default) | true|
|JavaMail System Properties|
EmailSender converts data records into emails. It can use input data to create the email sender and addressee, email subject, message body, and attachment(s). If no input edge is connected, this component sends one email.
If a record is rejected and an email is not sent, an error message
is created and sent to the
errorMessage field of metadata
on the output 1 (if it contains such a field).
To define the Message attribute, you can use the following wizard:
Figure 56.5. EmailSender Message Wizard
In this wizard, you specify a content of particular parts of an email message: drag and drop the proper field from the Fields pane to the Value column.
You can also specify values to be used if the mapped field is empty. The alternative values of these attributes should be typed to Alternative column. If a field is empty or has null value, the Alternative is used instead of the field value.
You can add additional headers using the plus button. This way, you set up Cc or Bcc.
The resulting value of the Message attribute will look like this:
From=$Fromemail@example.com Subject=$Subject|mySubject To=$To|toWhom MessageBody=$Message|myText
To send an email to multiple recipients, separate their addresses by comma ','.
If needed, use the same delimiter in the
Each field in the Properties table can be used as a template. Variable names are substituted with values from record.
For example, the MessageBody field contains
The Attachments attribute lets you add files as an email attachment.
The attachment can be a file with invariable path (static file) or a file whose name is received from an edge or a file whose content is received from an edge. These ways can be arbitrarily combined.
The attachment is specified as a sequence of individual attachments separated by semicolon. It is defined as a field name (file name received from an edge) or as a file name including its path or as a triplet of field name, file name of the attachment and its mime type. Each of these three parts of the triplet can be also specified using a static expression.
The attachments is added to the email using the following Edit attachments wizard:
Figure 56.6. Edit Attachments Wizard
You add the items by clicking the Attachment column of the Attachments pane or the button can be used.button and remove by clicking the button. Input fields can be dragged to the
If you want to edit any attachment definition, click the corresponding row in the Attachment column and the following attribute will open:
Figure 56.7. Attachment Wizard
In this wizard, you need to locate files, specify them using field names or the mentioned triplet. After clicking, the attachment is defined.
If you want to use non-ASCII characters in filenames of attachments, value of the
mail.mime.encodefilename needs to be set to
Any non-ASCII characters in the filenames will be encoded then (default is
Default MIME charset to use for encoded words and text parts that don't otherwise specify a charset (not only filename, but subject, message body as well)
can be specified using the
mail.mime.charset system property.
The default value is the value of the
file.encoding system property.
The EmailSender component is implemented using the JavaMail reference implementation library.
JavaMail specification lists Java system properties which control behavior of the JavaMail implementation,
see the JavaMail API documentation
for description of these properties.
-D Java VM parameter to set the value of a system property.
Metadata of EmailSender can have list and map fields. The map and list fields can be passed through, but they are not suitable for use in the component.