I want to send an email to each address in a text file and this is the code -
owners: read/lines %test.txt
emails: copy []
msg: "Dear accommodation owner..."
foreach address owners [append emails to-word address]
foreach address emails [send/subject to-email msg "Your accommodation added to search site"]
I tested this in the console and it worked fine, but the exact same code generated an error when it was run from a script:
** Script Error: Out of range or past end
** Where: to-word
** Near: to word! :value
This is probably something obvious, but I can't see why I'm getting the error, can anyone help?
Thanks,
Mike