in reply to Re: Re: Sendmail problems
in thread Sendmail problems

I think that there is no error message because your $! is being reset by the unlink. Using Net::SMTP, you would replace various of the prints with methods from Net::SMTP:

(where ... == the rest of the line) open (SENDMAIL ...) ==> $smtp=new Net::SMTP("localhost"); print SENDMAIL "HELO ..." ==> (implicit) print SENDMAIL "MAIL ..." ==> $smtp->mail(...); print SENDMAIL "RCPT ..." ==> $smtp->to(...); print SENDMAIL "DATA" ==> $smtp->data(); print SENDMAIL "..." ==> $smtp->datasend(stuff); print SENDMAIL "." ==> $smtp->dataend(); print SENDMAIL "QUIT" ==> $smtp->quit();

Note that your could replace the data/datasend/dataend chunk with a single data(@msg) call, if you build the text of the message into @msg.


Remember, when you stare long into the abyss, you could have been home eating ice cream.

Replies are listed 'Best First'.
Re: Re: Re: Re: Sendmail problems
by peterr (Scribe) on Oct 03, 2003 at 06:03 UTC
    I think that there is no error message because your $! is being reset by the unlink.

    Is there a method to reset my $! ?

    Using Net::SMTP

    Using a small test script, this appeared to work (after I got the SMTP server name right. :)

    Peter