[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] problem with script for unix



>I have a problem with script that is developed for Unix platform and
>include a command for sendmail (i think a default SMTP Server on unix
>server)
>this return this error
>
># syntax error, next 2 tokens "send_mail("
>
>TIA
>Giovanni Fuortes


The following subroutine works for me:


sub send_email {
	$to = "To: $recipient_address";
	$from = "From: $sender_address";
	$subject = "Subject: $subject_description";
	$message = "Message: \n$message_text\n";
	$mail_program = "/usr/lib/sendmail -t";
	open (MAIL,"| $mail_program") ||
 	     die "Error: Can't start $mail_program\n";

	print MAIL "$to\n$from\n$subject\n\n$message\n.\n";
	close (MAIL);
}



Good luck,

David Seay
http://www.mastercall.com/g-s



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch