AMX i!-EquipmentMonitor Pop3SetServer mail.mydomain.com, Pop3SetRefresh300,1, Pop3GetEmail0, CTo

Page 9

Running i!-EquipmentMonitor

Pop3SetServer ('mail.mydomain.com')

Or

Pop3SetServer ('192.168.12.175')

Next, you need to setup the user and password for the email account you will be retrieving email from. Your email administrator should supply you with a user name and password for an email account that can receive email. Once you have these, call Pop3SetUser() and supply these values like this:

Pop3SetRefresh(300,1)

// How often the check email server in

Seconds and should I delete?

 

Supplying a refresh time of 0 seconds disables automatic email retrieval. If you decide you want to retrieve email manually, all you need to do is call Pop3GetEmail(). Pop3GetEmail() takes 1 parameter: a flag (1 or 0) indicating if you want email deleted from the server. You can call Pop3GetEmail() even if you have setup for automatic email retrieval to force email to be retrieve. You might supply the user with a button to force email to be retrieved like this:

BUTTON_EVENT[dvPanel,6]

{

PUSH:

Pop3GetEmail(0);

}

You can check for the email to arrive by waiting for the offline message from the dvPop3Socket device. i!-EquipmentMonitor makes the emails available to you in three different variables: sPop3EmailMessage, nPop3QtyMail and nPop3TotalMail. nPop3QtyMail and nPop3TotalMail tell you how many email messages were retrieved (up to POP3_MAX_EMAILS, default = 20) and how many emails were on the server when i!-EquipmentMonitor last logged in. Up to POP3_MAX_EMAILS are downloaded and all other emails, if any, remain on the server until you retrieve them again.

sPop3EmailMessage is an array of structures containing the actual emails. The structure contains

the following items:

LmsgSize

The number of bytes in the email message.

cFrom[]

A string containing the senders email address.

cFromPersonal[]

The friendly name of the sender (if one was supplied).

cTo[]

A string containing the recipient's email address or addresses.

cToPersonal[]

The friendly name of the recipient if one was supplied.

cDate[]

A string containing the data and time the email was sent.

cSubject[]

The subject of the email.

cMessage[]

The body of the email.

NattachCount

The number of attachments to the email.

cAttachments[][]

The names of the files attached.

The subject and body are the items you need most in the structure. The count of file attachments tells you the total number of files attached but the cAttachments containing up to POP3_ATTACH_MAX (default is 5) file names. The attached files are not saved. Only the file names

are supplied for reference.

Continued

i!-EquipmentMonitor

5

 

 

 

 

Image 9
Contents EquipmentMonitor Software Limited Agreement Table of Contents Table of Contents Minimum PC Requirements Supported Operating SystemsInstalling i!-EquipmentMonitor Sending Email #INCLUDE i!-EquipmentMonitorOut.axiDvSmtpSocket = BUTTONEVENTdvTP,1 Receiving EmailThis is the body of my email! Wow, this is Cool #INCLUDE i!-EquipmentMonitorIn.axiPop3SetRefresh300,1 Pop3SetServer mail.mydomain.comSeconds and should I delete? BUTTONEVENTdvPanel,6Configuring for Timezone DATAEVENTdvPop3SocketSPop3EmailMessagenLoop.cAttachmentsnLoop1 EquipmentMonitorOut.axi EquipmentMonitorOut.axi ConstantsDvSmtpSocket SmtpQueMessage EquipmentMonitorOut.axi FunctionsSmtpSetTimeOff SetCHAR OffsetSmtpSetServer SmtpSetUser ConfigNotifyEncrBase64Encode SendNotifyEquipmentMonitorIn.axi Constants EquipmentMonitorIn.axiEquipmentMonitorIn.axi Functions Pop3SetRefresh Pop3SetServerPop3SetUser AMX reserves