-- set these properties outside of the event. That way they will only be set -- once each time the app is run, not once for each event. property crlf : (ASCII character 13) & (ASCII character 10) -- This is a standard header for HTML files. property http_10_header : "HTTP/1.0 200 OK" & crlf & "Server: MacHTTP" & crlf &  "MIME-Version: 1.0" & crlf & "Content-type: text/html" & crlf & crlf -- Idletime is how long you want it to remain open to -- wait for another event. Idletime is in seconds. -- Datestamp will contain the current date. Initialize it here. property idletime : 300 -- set to 5 minutes property datestamp : 0 -- this bit of code outside the sdoc event is executed at launch-time -- it is neccesary because an idle event can happen between -- launch and the receipt of an sdoc event (and in fact often does) set datestamp to current date -- This is the loop for AppleEvents received by the application. -- When you check the syntax, AppleScript will ask you to locate -- MacHTTP and will set the correct name at that time. on Çevent WWW½sdocÈ path_args  given Çclass kforÈ:http_search_args, Çclass postÈ:post_args, Çclass methÈ:method, Çclass addrÈ:client_address, Çclass userÈ:username, Çclass passÈ:password, Çclass frmuÈ:from_user, Çclass svnmÈ:server_name, Çclass svptÈ:server_port, Çclass scnmÈ:script_name, Çclass ctypÈ:content_type -- Variables available for use: -- http_search_args - stuff in the URL after a ? -- post_args - stuff in the URL after a $ -- method - GET, POST, etc. Used to tell if post_args are valid -- client_address - IP address or domain name of remote client's host -- from_user - non-standard. e-mail address of remote user -- username - authenticated user name -- password - authenticated password -- server_name - name or IP address of this server -- server_port - TCP/IP port number being used by this server -- script_name - URL name of this script -- content_type - MIME content type of post_args -- Using the "try" clause causes the "on error" routine to be run -- if an error occurs instead of crashing. -- If the error occurs outside the "try"/"end try" space then -- the "on error" routine is NOT run. try -- save the current date and time to check later for quitting set datestamp to current date -- Parse the post_args data into variables for processing -- this script only handles the post_args. Handling the other -- variables is trivial compared to this. set return_page to http_10_header  &  "
Message generated at: " & (current date)  & "" & "" set email_host to "homer.u.washington.edu" -- create new message in Eudora 1.4.3 (any later version will work as well) -- to compile this, you have to do "Check Syntax" and locate Eudora. -- Don't forget to configure Eudora correctly!! tell application "Eudora1.4.3" set newmessage to (make message InsertHere end of mailbox "Out" of mail folder "") set field "To" of newmessage to to_address set field "From" of newmessage to from_address set field "Subject" of newmessage to email_subject set field "" of newmessage to "From: " & username & return & return & email_body queue newmessage QueueType 0 end tell -- return the page created. A return statement ends the -- processing of the AppleEvent return return_page -- here is the routine to run if an error occurs -- errMsg contains the message sent by the System -- errNum contains the number of the error (negative for System, AE, or AS errors) on error errMsg number errNum -- create a page of HTML text to return set return_page to http_10_header  &  "