Emailer
Sends one email per input feature via Simple Mail Transfer Protocol (SMTP). Both HTML and Plain Text emails may be sent, each with one or more attachments.
To use this transformer, a server that accepts SMTP requests must be available and the connection parameters and authentication fully specified.
Input Ports
This transformer accepts any feature. One email will be sent for each feature that is received by the transformer.
Output Ports
Each input feature that results in a successfully sent email is output unchanged via this port.
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.
Parameters
Addressing
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
"Safe Support" <support@safe.com>
would result in recipients seeing Safe Support as the sender of the email, while specifying the address as:
support@safe.com
would have the recipients see just support@safe.com as the sender.
The email addresses of each of the primary recipients, separated by commas. The format of each address is identical to that for From.
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.
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
The text to be used as the subject of the email.
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
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.
Service
The type of email service you would like to connect to. The options are Generic SMTP, which requires that you specify the connection parameters and optionally authenticate with a username and password; and Gmail, which lets you use a new or existing connection to Gmail.
Connection
The connection parameters available depend on the value of the Email Service parameter. Parameters for each Email Service are detailed below.
The hostname of the SMTP server through which the email will be sent.
The connection port the SMTP server is listening on.
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).
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. If it is turned on, then a username and password for the SMTP service will be required.
The username for the SMTP server.
The password for the SMTP server.
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.
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.
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.
Editing Transformer Parameters
Using a set of menu options, transformer parameters can be assigned by referencing other elements in the workspace. More advanced functions, such as an advanced editor and an arithmetic editor, are also available in some transformers. To access a menu of these options, click beside the applicable parameter. For more information, see Transformer Parameter Menu Options.
Transformer Categories
Search FME Knowledge Center
Search for samples and information about this transformer on the FME Knowledge Center.