Industrial Automation
Industrial Automation | Europe

myKnowledge

Main > Product Type > Software > Visualisation
Minimize Text   Default    Enlarge Text
 

Print
E-mail

Sample For Sending Email From CX-Supervisor


Introduction
This is a sample application showing how to send an email from CX-Supervisor. It uses VBScript as based on the article How To Send An Email Alert From A PC. The sample project requires CX-Supervisor version 4.0 or later, and uses the "EmailText()" script function.
Example 

The attached example allows you to enter the email address, subject and body text and then send the email. The fields for cc, bcc and Attachments are optional, and can should be left blank if not used.

Configure your email server in the Developer from the Project menu, Runtime Settings->Email Settings:

  • Your SMTP server address (for example SMTP.gmail.com if using gmail smtp server)
  • The User for your email account name
  • The password for you email account. This is so the EmailText() script can log in to your email account to send the mail.


Fig. View of example

The following code is used to send the email message.

bSuccess = EmailText(Recipient, Subject, BodyText, cc, bcc, Attachments)
 

 
If you are using gmail SMTP server then you may get error "The message could not be sent to the SMTP server. The transport error code was 0x80040217.". For secure accounts you can create a unique application password to use for this service. For more info about configuring your gmail account to use "App Passwords" see Google Account: Sign in with App passwords and create a 'custom' password for this script. 
 
See also
Script Reference Manual or Help pages for description of EmailText() script function

 



Attachments

email_demo.zip - Size: 17096


Comments (View All Comments / Add Comment)

Related Articles
No related articles found.
Created 2017-06-01
Modified 2022-06-28
Views 6896

 

You are not logged in.