On Monday, July 15, 2002, at 04:03 , Jon Howe wrote:

> How do I capture the output from sendmail running under the -v switch back
> to my programme.
>
> The line I am using is -
>
> open (MAIL, "|/usr/lib/sendmail -oi -t -v") or die "cant fork proc to
> mail\n";

if you really want to 'catch' that, then you
clearly want to look at

        Net::SMTP

and/or the MailTools distribution...

in the above popen() construction, you are doing this to
'write' to the process, and would need to get into either

        a) the back-tick trick
                my $answer = `/usr/lib/sendmail ...... `;

        b) push the info into a file you will read later

                my $tmp_file = "/tmp/somefile.$$";              
                open (MAIL, "|/usr/lib/sendmail -oi -t -v > $tmp_file 2>&1 ")
                        or die .....

                close(MAIL);

                open(TMPF, $tmp_file )
                        or die ......

HTH

ciao
drieux

---


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to