Hello Folks,
I’m trying to send an email from UNIX System (Solaris 5.8 ) by running the perl script below:
*************************
#!/bin/perl
#sendmail.pl
open (SENDMAIL, "|/usr/lib/sendmail -oi -t -odq") or
die "Can't fork for sendmail: $!\n";
print SENDMAIL <<"EOF";
From: <frommail\@bla.com>
To: <tomail\@bla.com>
Subject: Here is the subject.
EOF
close (SENDMAIL) or warn "sendmail did not close nicely";
***********************************
but I’m getting the following:
No recipient addresses found in header
Can someone help me, please!?
I did not find too much information about sendmail so I cannot understand clearly how it should be configured.
if I change the script to:
#!/bin/perl
#sendmail.pl
open (SENDMAIL, "|/usr/lib/sendmail frommail\@bla.com ") or
die "Can't fork for sendmail: $!\n";
print SENDMAIL <<"EOF";
From: < frommail\@bla.com >
To: < tomail\@bla.com >
Subject: Here is the subject.
EOF
close (SENDMAIL) or warn "sendmail did not close nicely";
I am getting this email, however the email is coming empty – no sender address, no subject line – no nothing!
So, seems to me first script is basically working, however it cannot find the address to send the message to. Question – what header is it talking about?
Another question: if I’m using second script how do I specify recipient address?
How do I pass a subject and body of message?
Please, help!
Thanks in advance!
I’m trying to send an email from UNIX System (Solaris 5.8 ) by running the perl script below:
*************************
#!/bin/perl
#sendmail.pl
open (SENDMAIL, "|/usr/lib/sendmail -oi -t -odq") or
die "Can't fork for sendmail: $!\n";
print SENDMAIL <<"EOF";
From: <frommail\@bla.com>
To: <tomail\@bla.com>
Subject: Here is the subject.
EOF
close (SENDMAIL) or warn "sendmail did not close nicely";
***********************************
but I’m getting the following:
No recipient addresses found in header
Can someone help me, please!?
I did not find too much information about sendmail so I cannot understand clearly how it should be configured.
if I change the script to:
#!/bin/perl
#sendmail.pl
open (SENDMAIL, "|/usr/lib/sendmail frommail\@bla.com ") or
die "Can't fork for sendmail: $!\n";
print SENDMAIL <<"EOF";
From: < frommail\@bla.com >
To: < tomail\@bla.com >
Subject: Here is the subject.
EOF
close (SENDMAIL) or warn "sendmail did not close nicely";
I am getting this email, however the email is coming empty – no sender address, no subject line – no nothing!
So, seems to me first script is basically working, however it cannot find the address to send the message to. Question – what header is it talking about?
Another question: if I’m using second script how do I specify recipient address?
How do I pass a subject and body of message?
Please, help!
Thanks in advance!