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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

All I want to do is enable perl scripts to use sendmail.

Status
Not open for further replies.

UnDoug

Programmer
Dec 11, 2002
14
US
Hi,

At work, on our Sun Solaris servers, I write perl scripts that use sendmail to send messages.

On my home FreeBSD box, I haven't been able to get it to work.

Can anyone tell me or point me to a web resource that will tell me how to configure things so that perl scripts can send outgoing mail?

I don't need to receive mail at this point, just send it.

Do I need anything installed/configured other than sendmail?

Douglas
 
just use "system" for you to be able to send email. This enables you to execute system commands thru perl.
 
hi
you do need perl of course :). anyway, make sure that the path is right. FreeBSD perl is under
/usr/bin/perl by default.
here's a piece of code to show you how to send mail via sendmail, using sendmail as a regular file:

open(SPAM,"| /usr/sbin/sendmail -t");
print SPAM "From: $who_am_i\n";
print SPAM "To: $uname\@$domain_name\n";
......................
hth,
alex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top