Sending email

In order to send emails, you:

 

 

Note that when you create a mail, a supporting data tag struct is automatically created. Use the members of the struct to monitor the email status.

Email Struct

Name

Data Type

Definition

Success

Bit

ON=Sent Successfully

Failed

Bit

ON=Send Failed

Initialization Status

UINT32

Code

 Message

0

No Errors

1

Function Started

2

Function in Progress

-1

General COM Error. Please check the physical connections.

-2

TimeOut error

-3

DNS error

-4

Attach File error

-5

Access denied

-6

Parse Data error

-7

Recipient email address error

-8

Packet size exceeded

-9

Attachment Error: No file exists/was found in the email's Configuration

 

 

-10

 unable to get local issuer certificate' when sending an email

 

Using UniApps to Select and Edit email Accounts

If you have more than one Account defined in your project, users can select an account and edit the From, Username, and Password parameters, as well as Server settings.

 

App Passwords

To enable UniStream to access Gmail, your Google account must have activated:

How to Activate 2-Step VerificationHow to Activate 2-Step Verification

In your Google Account Settings, turn on 2-Step Verification as follows:

  1. Enter your Google Account.
    Click your user icon, select Manage from the drop-down menu, and click Manage your Google account.


  2. Select Security

  3. Turn on 2-step verification.

  4. Click Get Started.

  5. Enter your password and click Next.


  6. Google will send a verification code to your bell phone. Enter the code and click Next.

  7. Activate 2-step verification by clicking Next.

How to Activate and Get an App PasswordHow to Activate and Get an App Password

When 2-Step Verification is activated in your account, you can activate and get an App Password.

  1. Enter your Google Account.
    Click your user icon, select Manage from the drop-down menu, and click Manage your Google account.

  2. Select Security, scroll down tp App passwords and click it.


  3. Click Select app, and select Other.



  4. Enter UniLogic, and click Generate.


  5. Google will reveal the App Password. Record it, copy to Clipboard, and click Done
    This is the password that you enter into UniLogic, and that will be downloaded into the PLC, enabling Google to identify the PLC.

Ensure that you record this password, Google will not show it again. You can generate another password, but remember that you must then edit the controller's email settings.

Entering the App Password in UniLogic

  1. Paste/enter the app password into your UniLogic project and download it to the controller; now Google will be able to verify the controller, and emails may be sent and received via gmail according to your UniLogic program.


 

 

If you are connected to the Internet, you can access this UniLogic tutorial:

Sending email