At 02:19 PM 2/3/95 EDT, Bill Pennington wrote: >We need an automated way to transfer files to local and remote users from >our HP 987. We would like to transfer these files via E-mail if possible. We >use an MHS based E-mail package and we have the SMTP module. I have looked >at NetMail/3000 but it seems to be overkill just to transfer files. We don't >need to have a full blown E-mail system on the 3k. Also we dont' want to >dedicate a PC to run a script to download files at a certain time because we >would like it to be on demand. If anyone can lead me to something that fits >our needs it would be greatly appreciated! > >Bill Pennington - Harris Chemical Group Assuming you have the host names & email addresses, its a pretty trivial to write a network program to send messages from the 3000 through an SMTP service (generally on port 25). So to send mail, you simply send a very simply series of commands terminated with a newline (LF). These are: MAIL FROM: <sender> RCPT TO: <recipient> DATA After the DATA command, you simply send the lines of the message. To finish the message send a line with a full stop ('.') alone. Naturally, you should check the error codes after each command. The replies from the SMTP service all have a 3 digit code (similar to the FTP protocol), indicating success, error, or failure. The sender and recipient names should be in proper internet format (RFC822). Close the connection and you're done. Multiple messages can be sent during one connection by repeating the above sequence. There are more tricks, too, but first you might want to get your feet wet. Here's a test I've done that's easy to try. Simply use Telnet (eg Dave Elward's Telnet for the 3000 works great!) to connect to your SMTP service. For example, I do the following: :RUN TELNET.UTIL.SYS;INFO="george 25" Trying... Connected to george. Escape character is '^]'. 220 george.vcs.com.au HP Sendmail (1.38.193.5/16.2) ready at Fri, 3 Mar 1995 08:51:45 +1100 Then type HELP followed by the Enter/Return key. Don't be surprised if it doesn't echo your characters typed. Anyway, I found the whole programming stint to be pretty simple, and have added e-mail messages to a couple of our apps. Now if something goes wrong, I get a high priority message informing me. Imagine...if your app was blowing up, rather than dumping all over the user screen, you could do simulate some DBEXPLAIN or PRINTFILEINFO stuff and send it off directly to the computer department directly. On a local net, its real fast, but it would work, even if the user's computers were interstate (provided they had SMTP!). For your particular case, if you are sending binary files you will still need a way of UUENCODING before sending and UUDECODING the files upon receipt. Fortunately, I think those programs are included with 5.0 if you have that. Otherwise, the algorithm is so straightforward its another simple programming job. Depending on the data though, you may prefer to develop your own callable routines, rather than using external programs. So much for sending messages and files on the 3000...how about receiving? Well, I've not needed to do that, but since we run a POP3 service on our HPUX box anyway, I would probably look at that protocol. Otherwise, I would need to write a SMTP (port 25) service that could receive the same commands as above and process them. POP3 sounds easier, but this is with no experience. Documents describing the SMTP and POP3 as well as the Mail Headers can be found in RFC documents in a location near you. RFC821 SMTP RFC822 Standard format of ARPA Internet text messages RFC1225 Post Office Protocol Version 3 (POP3) RFC145-28 SMTP Service extensions (better binary transfers) I hope this helps. ---- Jim Wowchuk Internet: [log in to unmask] Vanguard Computer Services Compu$erve: 100036,106 _--_|\ Post: PO Box 18, North Ryde, NSW 2113 / \ Phone: +61 (2) 888-9688 \.--.__/ <---Sydney NSW Fax: +61 (2) 888-3056 v Australia