> Hi all
> I am trying to send a mail with the following code and the last print 
> statement doesn't print, ie, the mail is not sent.
> This code is called on submitting a form on the web
> --------------------
> open(MAIL, "/usr/sbin/sendmail -oi -t") || die "Can't open mail";
> print MAIL <<END;
> To: amancgiperl\@hotmail.com
> Subject: News
> all the message goes here
> END
> 
> close(MAIL);
> print "The mail has been sent successfully<BR><BR>";
> ---------------------

You're missing the pipe symbol before /usr/sbin/sendmail so it's probably going to try 
to open the file for read - not what you intented.

As others have suggested, put a check on the close as well, eg:

close (MAIL) or die "Could not send mail: $!\n";

Cheers,
Kingsley.

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

Reply via email to