iTP Active Transaction Pages (iTP ATP) Programmer's Guide
ATP Web Page and Script Structure
iTP Active Transaction Pages (iTP ATP) Programmer’s Guide—522292-002
3-15
Using TCP/IP Sockets from JavaScript
Using TCP/IP Sockets from JavaScript
The directory called sockets within the ATP examples directory contains several 
examples that show sockets script structure. The file 
/examples/sockets/sendmail.atp shows how to use the ATP sockets 
interface to send an electronic-mail message using the Simple Mail Transfer Protocol 
(SMTP). 
Selections from the file sendmail.atp are displayed with accompanying text below. Print 
that file or display it on screen if you need to see the complete code.
The example script in Example 3-8
 contains only enough HTML to permit invocation 
from a browser. No HTML would be needed to run the script in an OSS shell 
environment. 
The code starts with error handling in Example 3-9
.
Example 3-7. Display of HTML Data for NonStop TUXEDO
<server>
do {
</server>
<tr>
...
...
...
</tr>
<server>
}
while (nextAcct() ...;
</server>
Example 3-8. TCP/IP Sockets Script Structure
<head>
<title>Using SMTP With Server-Side JavaScript Sockets</title>
</head>
<body>
<h3>Using SMTP With Server-Side JavaScript Sockets</h3>
<server>










