Running i!-equipmentmonitor, Sending email – AMX i!-EquipmentMonitor User Manual

Page 7

Advertising
background image

Running i!-EquipmentMonitor

3

i!-EquipmentMonitor

Running i!-EquipmentMonitor

Very little work is required to add e-mail support to your existing NetLinx code. Receiving and

sending e-mail are independent of each other; each one will be covered in it's own section. You do

not need to add support for sending and receiving if only one of the features is needed.

Sending Email

To support sending email, first include the i!-EquipmentMonitorOut.axi (page 7) into your

program:

#INCLUDE 'i!-EquipmentMonitorOut.axi' // Include to send email

Next, make sure that the default IP local port used by i!-EquipmentMonitorOut.axi is available on

your system. i!-EquipmentMonitorOut.axi uses local port 0:10:0 for sending emails. Make sure

there is no current entry in your

DEFINE_DEVICE

section for 0:10:0. If there is a current entry for

0:10:0, you can change the existing entry to another local port number or override the default local

port used by

i!-EquipmentMonitorOut.axi like this in the

DEFINE_DEVICE

section:

dvSmtpSocket = 0:3:0

Next, you need to initialize the SMPT server value by calling

SmptSetServer()

. You need the

name or IP address of your local SMPT server, which you can obtain from you Network

administrator. Using a name for the server is acceptable if you have DNS properly configured on

the NetLinx Master. Otherwise, you need an IP address. Make sure to use the SMPT server value

here. Often, the "email server" refers to the POP3 server; most likely, this is not what you need.

Once you have the correct SMPT server name or address, call

SmptSetServer()

like this:

SmtpSetServer('smtpserver.mydomain.com')

or

SmtpSetServer('192.168.12.175')

If the SMTP email server requires user authentication to send email, you must configure i!-

EquipmentMonitor with the username and password of a valid account registered to the SMTP

server. You can do this by calling the SmtpSetUser() function. This line is typically included

immediately after the SmtpSetServer() initialization command function. An example is provided

below:

SmtpSetUser('user1','password') // include only if you need SMTP authentication

If the SMTP email server allows anonymous access and does not require authentication, you simply

comment out the previous SmtpSetUser() function call. Without an SMTP username and password

configured, i!-EquipmentMonitor will connect to the SMTP server with anonymous access.

Advertising