[REBOL] Help with script to send
From: psa102:toward at: 15-Aug-2004 17:33
Can someone help me with the script below. The error message is:
"Component: "System Port" 1.1.2.5 (30-Sep-2003/16:57:26)
Script: "User Preferences" (20-May-2001/21:08:16-4:00)
Script: "Send message with attachment script" (8-Aug-2004)
** Script Error: Invalid argument:
** Where: to-file
** Near: to file! :value"
I presume the problem is that the words messagefile, addressfile, etc. are not properly
typed or the
argument values are not properly loaded into them.
The first argument, messagefile, is the filename (drive,path, and filename) of a text
file that contains
the message to be sent. The message consists of lines, each 60 characters or less, ending
with an 0D0A.
The second argument, addressfile, is a text file with email addresses in it (one per
line). Attachfile is
a file with one or more filenames in it. This script is to be used to distribute messages
with one or
more attachments to a community email list.
The Rebol file is loaded by a REXX script that is also included below.
- - - - - - - - - - -
REBOL [
Title: "Send message with attachment script"
File: %sendattach6.r
Author: "jwirt"
Date: 8-8-04
Purpose: { Load an email script from command line, two arguments.
Uses REBOL 2.5.8.3.1 }
]
arguments: parse/all system/script/args none
addressfile: to-file first arguments
messagefile: to-file next arguments
attachfiles: to-file next arguments
members: make block!
message: make string!
attachfiles: make block!
message: read/lines messagefile
members: load addressfile
attachfiles: [%test1.txt %test2.txt]
send/attach members message attachfiles
.. . . . . . . .
/* test shell for send attachment */
messagefile="message.txt"
addrfile="localaddresses.txt"
attachfile = "test1.txt"
address cmd
ok=directory("d:\rebol")
rebol.exe sendattachtest6.r
addrfile read messagefile attachfile
address