Hi ,
I am trying to send mail from unix perl.
I am using following code to send mail.
It is not triggering mail and also it is not giving any error.
please tell me any special settings are required or this program should be executed from special user with higher permission or something.
please tell me.
what changes i should bring into this program so that this program should work fine.
[CODE=perl]#!/usr/perl/bin/perl
print "Content-type: text/html\n\n";
$title='Perl Mail demo';
$to='shafi.moha mmed@expt.com';
$from= 'helpdesk.in@ex pt.com';
$subject='YOUR SUBJECT';
open(MAIL, "|/usr/sbin/sendmail -t") || die "unable to open";
print "hhhh ",<MAIL>,"\ n";
## Mail Header
print MAIL "To: $to\n";
print MAIL "From: $from\n";
print MAIL "Subject: $subject\n\n";
## Mail Body
print MAIL "This is a test message from Cyberciti.biz! You can write your mail body text here\n";
close(MAIL);[/CODE]
shafi
I am trying to send mail from unix perl.
I am using following code to send mail.
It is not triggering mail and also it is not giving any error.
please tell me any special settings are required or this program should be executed from special user with higher permission or something.
please tell me.
what changes i should bring into this program so that this program should work fine.
[CODE=perl]#!/usr/perl/bin/perl
print "Content-type: text/html\n\n";
$title='Perl Mail demo';
$to='shafi.moha mmed@expt.com';
$from= 'helpdesk.in@ex pt.com';
$subject='YOUR SUBJECT';
open(MAIL, "|/usr/sbin/sendmail -t") || die "unable to open";
print "hhhh ",<MAIL>,"\ n";
## Mail Header
print MAIL "To: $to\n";
print MAIL "From: $from\n";
print MAIL "Subject: $subject\n\n";
## Mail Body
print MAIL "This is a test message from Cyberciti.biz! You can write your mail body text here\n";
close(MAIL);[/CODE]
shafi
Comment