02-02-05 12:45 PM
pete wrote:
> Hi,
>
> I'm trying to use nail via a cron job to mail me some files on a daily
> basis; trouble is, I can't get nail (or mail) to run non-interactively:
>
> mail pete@example.com -s "test"
Yes, this line of course not complete as mail needs you to input the
message body. You can use echo, or cat, or commandline input to supply
it so that you run it in a script. For example:
echo "test email" | mail pete@example.com -s test
or
mail pete@example.com -s test <<EOF
write anything here as message body
EOF
> or
>
> nail pete@example.com -s "test" -a "attachment.tar"
As above, mail need input for message body.
I am not sure what is the difference between "mail" and "nail". For all
the versions of "mail" I used, I don't think it can take -a option for
an attachment. Maybe this is what "nail" can do?
I never use mail to send a binary file but I guess "cat" can still do
the job, or maybe some binary-to-ascii and ascii-to-binary utilities are
additionally needed.
> In both cases it hangs, waiting for the message body. Any ideas? the man
> pages doesnt seem to mention this.
In a summary, you need supply the message body in the script, even it
*is* empty.
HTH,
--
NT stands for New Technology. Windowds NT(NT4.x)/2K(NT5.0)/XP(NT5.1)
was built on NT Technology. Anyone understands what "new" means, so
everyone knows M$ Windows NT/2K/XP/Whatever is a *real* innovation.
[ Post a follow-up to this message ]
|