|
|
File and Mail Services Continued from Session Management File System Service lets you store persistent data and manipulate files. The File object is not intended for working with databases but is very useful when you need an easy-to-use data-storage solution. You use File to read, write, and search for files on the application server. You can't use File to work with files on the user's system. File can work with both ASCII text and binary-formatted files, but reading and writing ASCII is much easier, because you can read and write data line-by-line or use strings. With binary files, on the other hand, you must break strings down into individual characters before you read or write. These individual characters are one byte in length and must be converted to a numeric value for reading and writing. Mail Service consists of the SendMail object; you use it to generate mail messages within server-side JavaScript applications. The term SendMail may remind you of the Unix process used to generate mail messages, but the SendMail object is available for both Windows and Unix environments. SendMail lets you send multimedia such as images, sound files, and videos and also supports the multipart message syntax, which lets you send messages with attachments. Once you create an instance of SendMail, you can use its properties to determine the fields used in your e-mail messages, how content is encoded, and where the message is sent. Generally, properties of SendMail correspond to actual fields in the e-mail message. For example, you use the To property to name recipients and the From property to name the sender. SendMail directly supports the general fields used with standard SMTP servers, so you can create properties for custom fields as well, and then use these fields with custom mail servers or clients. Because custom fields are sent in the message header, they are generally subject to the restrictions of RFC 822, the specification that defines the standard for Internet messages (which states that all user-defined fields should have the prefix X-). Next: Database Access Published as PC Tech Feature in the 5/4/99 issue of PC Magazine. Related Links |
|
TOP |
Copyright (c) 1999 Ziff-Davis Inc. |