Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> Perl >> Snippet

sendmail


open (SENDMAIL, "|/usr/lib/sendmail -oi -t -odq" ) or die "Can't fork for sendmail: $! \n " ;
print SENDMAIL << "EOF" ;
From: User Originating Mail < me\@host >
To: Final Destination < you\@otherhost >
Subject: A relevant subject line

Body of the message goes here after the blank line
in as many lines as you like .
eof
close (SENDMAIL)      or warn "sendmail didn't close nicely" ;