Topic: P296

Simple Mail Transfer Protocol (SMTP)

Mail Accounts (SMTP)

Simple Mail Transfer Protocol (SMTP) is an Internet standard for sending electronic mail (email). Although electronic mail servers and other mail transfer agents use SMTP to send and receive mail messages, user-level client mail applications typically use SMTP only for sending messages to a mail server.


In order to send an email from the PLC, the Send Email (EMAL) instruction requires that you have an e-mail server widget defined and configured. The widget contains the necessary network communication settings for an e-mail server external to the PLC. The external mail server can be from an e-mail provider (such as Gmail) or can be set up inside an organization (such MS Exchange). The programming software provides preconfigured templates for 4 common e-mail providers. It also provides a generic template that can specify any desired e-mail server.

Note: Maximum of 4 mail accounts allowed.


SMTP Configuration

  1. Account Name: Unique User Defined name for each SMTP service (32 character limit).
  2. Use IP Address: Enter the IP address of SMTP server (for Generic Account only) if the IP radio button is selected or if the tag radio button is selected, a String tag is required in this field.

Note: Using a tag in the IP address field is only available with P2-622 and new (next-generation) CPUs.

  1. User Server Name:Enter name of SMTP server. Example: smtp.gmail.com (Grayed out for preconfigured accounts).

Note: DNS service must be configured in the CPU Ethernet Ports tab in Hardware configuration or through Choose CPU "CPU Connections" window.


Note: Do not enter an IP address in this field.


  1. Encryption: Used when establishing an encrypted connection to a secure SMTP server. Once the connection is encrypted, all data sent through that connection is sent through the encrypted channel. However, if you forward a message that was sent through a TLS-encrypted connection, that message isn't neccessarily encrypted as TLS doesn't encrypt the message, just the connection. (Grayed out for preconfigured accounts)
  1. Port Number: Enter tag to be used for offset. Value is in minutes.
    • STARTTLS: Default 587
    • SMTPS: Default 465
  1. SMTP Server Response Timeout:  (default 10 seconds, maximum 60 seconds) When attempting to connect to an SMTP server, if the server does not respond to an SMTP command within this time period, the transaction will be stopped. This can occur if the mail server is busy.
  2. Verify Mail Server Certificate: When the Productivity Suite creates the SMTP Client, it can use a Root CA certificate to validate the mail server identity. The Root CA certificate is attached to the SMTP Client device and becomes part of the project and is downloaded to the CPU. Each time an EMAL instruction uses the SMTP Client device, the mail server certificates are validated as part of establishing the encrypted connection.

Note: Ensure CPU date & time is within 2 weeks of current if using a CA certificate in your mail account configuration or you may receive a "TLS handshake" error.

Note: Only Root Certificates with .cer extensions accepted.

  1. Authentication:
    • No Authentication:  Select this option if the SMTP server does not require authentication.
    • Use Authentication:  Authenticate by logging into the SMTP Server with the Username and Password specified below.
    • User Name: No character limit for static text. If using a string tag, there is a 128-character limit.

    • User Password:
    • Password can be static text (20-character limit).
    • P2-622 and newer CPU’s: If the PW radio button is selected, enter static text (128-character limit), or if the tag radio button is selected a String tag is required in this field (128-character) limit.

    Note: Using tags in the User Name and User Password fields is only available with P2-622 and newer (next-generation) CPUs.