FME Transformers: 2024.1
FME Transformers: 2024.1
Emailer
Sends one email per input feature via Simple Mail Transfer Protocol (SMTP), Gmail, or Microsoft Mail. Both HTML and Plain Text emails may be sent, each with one or more attachments.
To use this transformer with SMTP, a server that accepts SMTP requests must be available and the connection parameters and authentication fully specified.
To use Gmail or Microsoft Mail, valid account credentials are required.
Examples
SMTP Connection Parameter Examples
To send an email, the host name, receiving port, and encryption method must be specified. Each of these is described above. Consult your system administrator for the settings you should use for the SMTP server parameters, but as a starting point, here are the settings for several common SMTP servers:
Amazon Simple Email Service (SES):
Parameter |
Value |
---|---|
Host | email-smtp.<region>.amazonaws.com |
Port | 587 |
Encryption | TLS |
Sender Authentication | Yes |
Sender's Username | <your SES-generated username> |
Sender's Password | <your SES-generated password> |
Substitute your region for <region> in the Host. For example, if your AWS region was us-east-1, then your host would be email-smtp.us-east-1.amazonaws.com
Google Gmail:
Parameter |
Value |
---|---|
Host | smtp.gmail.com |
Port | 587 |
Encryption | TLS |
Sender Authentication | Yes |
Sender's Username | <your Gmail address> |
Sender's Password | <your Gmail password> |
Note that using Gmail to send SMTP messages requires you to have to disable security on your Gmail account by following the instructions at https://www.google.com/settings/security/lesssecureapps and therefore is not recommended. Using the Gmail option for the Email Service parameter is preferred, since this will authenticate using OAuth 2.0, as recommended by Google.
Insecure Relay:
Parameter |
Value |
---|---|
Host | <your hostname> |
Port | 25 |
Encryption | None |
Sender Authentication | No |
You may have an in-house relay available to you. Default settings such as the above may work in such a case, but these are not recommended for a production system.
Usage Notes
-
This transformer is often used to notify recipients of translation status. It is often used downstream from the FeatureWriter to either send statistics of the translation, or in fact the output of the translation, via email. The TempPathnameCreator transformer may be useful in such workflows.
Configuration
Input Ports
Input
This transformer accepts any feature. One email will be sent for each feature that is received by the transformer.
Output Ports
Sent
Each input feature that results in a successfully sent email is output unchanged via this port.
<Rejected>
Each input feature whose email could not be sent is output via this port. An fme_rejection_code attribute, having the value ERROR_DURING_PROCESSING, will be added, along with a more descriptive fme_rejection_message attribute which contains more specific details as to the reason for the failure.
Note If a feature comes in to the Emailer already having a value for fme_rejection_code, this value will be removed. This removal occurs even if the feature is not rejected by the Emailer.
Parameters
Service
Email Service |
Select the type of email service to connect. Options include:
|
Connection
The connection parameters available depend on the value of the Email Service parameter. Parameters for each Email Service are detailed below.
Generic SMTP
Host |
The hostname of the SMTP server through which the email will be sent. |
||||
Port |
The connection port the SMTP server is listening on. |
||||
Encryption |
The method used to secure the email contents as it is sent. Valid values are None (no security), TLS (Transport Layer Security), and SSL (Secure Sockets Layer). |
||||
Timeout |
The number of seconds to wait for the SMTP server to send the email. If the email is not sent in time, the sending is cancelled and the triggering feature will be output via the <Rejected> port. |
||||
Sender Authentication |
Specifies whether or not the SMTP server requires authentication. When enabled, a username and password for the SMTP service are required.
|
Gmail
Gmail Connection |
Specifies a new or existing web connection to Gmail. This could be for the Google Gmail service, or you could create a new service based on it. See the Web Connections documentation for more details. |
Timeout |
The number of seconds to wait for Gmail to send the email. If the email is not sent in time, the sending is cancelled and the triggering feature will be output via the <Rejected> port. |
Microsoft
Microsoft Mail Connection |
Specifies a new or existing web connection to Microsoft Mail . This could be for the Microsoft Mail service, or you could create a new service based on it. See the Web Connections documentation for more details. |
Timeout |
The number of seconds to wait for the server to send the email. If the email is not sent in time, the sending is canceled and the triggering feature will be output via the <Rejected> port. |
Request
When Email Service is Gmail or Microsoft, the Request group is enabled.
Gmail
Action |
Select an action to perform:
|
Microsoft
Action |
Select an action to perform:
|
Addressing
From |
The email address of the sender. The standard SMTP email address format consists of an optional display name enclosed in quotation marks (" ") followed by the actual email address enclosed in < >, or just the email address. For example, specifying the address as: "FME Lizard" <liz@safe.com> would result in recipients seeing FME Lizard as the sender of the email, whereas specifying the address as: liz@safe.com would have the recipients see just liz@safe.com as the sender. Note that when using a Gmail connection, the email address of the sender must match the account name of the Gmail web service connection. |
To |
The email addresses of each of the primary recipients, separated by commas. The format of each address is identical to that for From. |
Cc |
The email addresses of each of the carbon-copied (Cc’d) recipients, separated by commas. The format of each address is identical to that for From. |
Bcc |
The email addresses of each of the blind-carbon-copied (Bcc’d) recipients, separated by commas. The format of each address is identical to that for From. |
Message
Subject |
The text to be used as the subject of the email. |
Body |
The content of the email message. The content can contain HTML markup. In addition to font styling and tables, images attached to the email can be embedded into the message as well by referencing the “content ID” of the attachment using the syntax: <img src="cid:<content id>"/> For example: <img src="cid:map.jpg"/> would embed the image attached to the email with the Content ID map.jpg |
Headers |
Zero or more additional headers can be attached to the email. Header names are case-insensitive. Information on commonly accepted email headers can be found at IANA Message Headers. If the header set could have been specified by a transformer parameter (such as From or To), the feature will be rejected. |
Attachments |
Zero or more files can be attached to the email. These may be static files that do not change from sent email to sent email, or they may be intermediate translation results created by a TempPathnameCreator/FeatureWriter combination. For each attached file, the full pathname to the file must be specified. An optional Content ID can be given, which can be referenced in an HTML body, and will also set the default filename for that attachment if the recipient elects to save the attachment. Lastly, a MIME type can be specified. For most situations, autodetect is the best and most robust option, but specific MIME types can also be set. |
Editing Transformer Parameters
Transformer parameters can be set by directly entering values, using expressions, or referencing other elements in the workspace such as attribute values or user parameters. Various editors and context menus are available to assist. To see what is available, click beside the applicable parameter.
How to Set Parameter Values
Defining Values
There are several ways to define a value for use in a Transformer. The simplest is to simply type in a value or string, which can include functions of various types such as attribute references, math and string functions, and workspace parameters.
Using the Text Editor
The Text Editor provides a convenient way to construct text strings (including regular expressions) from various data sources, such as attributes, parameters, and constants, where the result is used directly inside a parameter.
Using the Arithmetic Editor
The Arithmetic Editor provides a convenient way to construct math expressions from various data sources, such as attributes, parameters, and feature functions, where the result is used directly inside a parameter.
Conditional Values
Set values depending on one or more test conditions that either pass or fail.
Parameter Condition Definition Dialog
Content
Expressions and strings can include a number of functions, characters, parameters, and more.
When setting values - whether entered directly in a parameter or constructed using one of the editors - strings and expressions containing String, Math, Date/Time or FME Feature Functions will have those functions evaluated. Therefore, the names of these functions (in the form @<function_name>) should not be used as literal string values.
Content Types
These functions manipulate and format strings. | |
Special Characters |
A set of control characters is available in the Text Editor. |
Math functions are available in both editors. | |
Date/Time Functions | Date and time functions are available in the Text Editor. |
These operators are available in the Arithmetic Editor. | |
These return primarily feature-specific values. | |
FME and workspace-specific parameters may be used. | |
Creating and Modifying User Parameters | Create your own editable parameters. |
Dialog Options - Tables
Table Tools
Transformers with table-style parameters have additional tools for populating and manipulating values.
Row Reordering
|
Enabled once you have clicked on a row item. Choices include:
|
Cut, Copy, and Paste
|
Enabled once you have clicked on a row item. Choices include:
Cut, copy, and paste may be used within a transformer, or between transformers. |
Filter
|
Start typing a string, and the matrix will only display rows matching those characters. Searches all columns. This only affects the display of attributes within the transformer - it does not alter which attributes are output. |
Import
|
Import populates the table with a set of new attributes read from a dataset. Specific application varies between transformers. |
Reset/Refresh
|
Generally resets the table to its initial state, and may provide additional options to remove invalid entries. Behavior varies between transformers. |
Note: Not all tools are available in all transformers.
For more information, see Transformer Parameter Menu Options.
FME Community
The FME Community is the place for demos, how-tos, articles, FAQs, and more. Get answers to your questions, learn from other users, and suggest, vote, and comment on new features.
Search for all results about the Emailer on the FME Community.