in reply to Re^4: need help with FTP script
in thread need help with FTP script

You need to put the recipient on the command line, as well as in the headers:
open(MAIL, "|/usr/sbin/sendmail -t $recipient") || die "Cant send mail +. Reason: $!";
Sendmail determines where the mail is going from the command line.

We're not really tightening our belts, it just feels that way because we're getting fatter.

Replies are listed 'Best First'.
Re^6: need help with FTP script
by cc (Beadle) on Jun 15, 2004 at 23:21 UTC
    hi Roy

    I've changed but still doesn't work.
    I think without -t, because:
    " sendmail: fatal: cannot handle command-line recipients with -t "

    I don't understand, if I try only this simply mail script then works well and I get mails:
    #!/usr/bin/perl -w my $recipient = "xxx\@mydomain.net"; my $sender = "yyy\@mydomain.net"; open(MAIL, "|/usr/sbin/sendmail -t") || die "Cant send mail. Reason: $ +!"; print MAIL "from:$sender\n"; print MAIL "to:$recipient\n"; print MAIL "subject: test mail\n"; print MAIL "Time: ", scalar localtime, "\n"; close(MAIL);
    I think the problem is the combination with the transfer script.

    kind regards
    cc
      I've found out:

      the mail should be send before "die"

      thanks anyway.

      greetings
      cc