We assume that you have already learned what is described in:
If you want to find the right Writer for your purposes, see Writers Comparison.
EmailSender sends e-mails.
Component | Data output | Input ports | Output ports | Transformation | Transf. required | Java | CTL |
---|---|---|---|---|---|---|---|
EmailSender | flat file | 1 | 0-1 | no | no | no | no |
EmailSender converts data records into e-mails. It can use input data to create the e-mail sender and addressee, e-mail subject, message body, and attachment(s).
Port type | Number | Required | Description | Metadata |
---|---|---|---|---|
Input | 0 | yes | For data for e-mails | Any |
Output | 0 | no | For successfully sent e-mails. | Input 0 |
1 | no | For rejected e-mails. | Input 0 plus field named
errorMessage 1) |
Legend:
1): If a record is rejected and e-mail 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).
Attribute | Req | Description | Possible values |
---|---|---|---|
Basic | |||
SMTP server | yes | Name of SMTP server for outgoing e-mails. | |
SMTP user | Name of the user for an authenticated SMTP server. | ||
SMTP password | Password of the user for an authenticated SMTP server. | ||
Use TLS | By default, TLS is not used. If set to
true , TLS is turned on. | false (default) | true | |
Use SSL | By default, SSL is not used. If set to
true , SSL is turned on. | false (default) | true | |
Message | yes | Set of properties defining the message headers and body. See E-Mail Message for more information. | |
Attachments | Set of properties defining the message attachments. See E-Mail Attachments for more information. | ||
Advanced | |||
SMTP port | Number of the port used for connection to SMTP server. | 25 (default) | other port | |
Trust invalid SMTP server certificate | By default, invalid SMTP server certificates are not
accepted. If set to true , invalid SMTP server
certificate (with different name, expired, etc) is accepted. | false (default) | true | |
Ignore send fail | By default, when an e-mail is not sussessfully sent, graph
fails. If set to true , graph execution stops even
if no mail can be sent successfully. | false (default) | true |
E-Mail Message
To define the Message attribute, you can use the following wizard:
In this wizard, you must copy the fields from the Fields pane on the left to the Value column of the Properties pane on the right. Use the Right arrow button or drag and drop the selected field to the Value column. In addition, you can also specify alternative values of these attributes (Alternative column). In case some field is empty or has null value, such Alternative is used instead of the field value.
The resulting value of the Message attribute will look like this:
From=$From|my@mail.com;Subject=$Subject|mySubject;To=$To|toWhom;MessageBody=$Message|myText
E-Mail Attachments
One of the possible attributes is
Attachments. It can be specified as a sequence of
individual attachments separated by semicolon. Each individual
attachment is either file name including its path, or this file name
(including path) can also be specified using the value of some input
field. Individual attachment can also be specified as a triplet of field
name, file name of the attachment and its mime type. These can be
specified both explicitly ([$fieldName, FileName,
MimeType]
) or using the field values:
[$fieldNameWithFileContents, $fieldWithFileName,
$fieldWithMimeType]
. Each of these three parts of the
mentioned triplet can be specified also using a static expression. The
attachments must be added to the e-mail using the following
Edit attachments wizard:
You adds the items by clicking the Attachment column of the Attachments pane or the button can be used. If you want to edit any attachment definition, click the corresponding row in the Attachment column and the following attribute will open:
button, remove by clicking the button, input fields can be dragged to theIn this wizard, you need to locate files, specify them using field names or the mentioned triplet. After clicking
, the attachment is defined.