Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sendmail >>>No recipient addresses found in header

Status
Not open for further replies.

solaruser

Technical User
Apr 13, 2005
2
0
0
US
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!
 
Try this and see what happens

Code:
open (SENDMAIL, "|/usr/lib/sendmail -oi -t") or
die "Can't fork for sendmail: $!\n";

All I did is removing -odq. The above code works for me in Linux.
 
varakal,
Thank you!
unfortunately
“open (SENDMAIL, "|/usr/lib/sendmail -oi -t")”
doesn’t work
I think the problem is not in the script but in the sendmail configuration, because it is complaining about "header"

predamarcel !
Thank you!
it works!
Thank you so much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top