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

mail

Status
Not open for further replies.

korndogg

Programmer
Jun 26, 2000
22
0
0
BA
need a simple sendmail CGI script
 
If you are on a UNIX system with sendmail, this should work.&nbsp;&nbsp;Slightly altered to protect the innocent from a copy that works, but I may have introduced a typo.<br><br><FONT FACE=monospace><br>#!/usr/local/bin/perl<br>$mailprog = '/usr/lib/sendmail'; # <font color=red>point this to your sendmail</font><br>$hdr = 'Some Header Stuff Here';<br>$recipient = '<A HREF="mailto:whoever@whereTheyAre.com">whoever@whereTheyAre.com</A>';<br>$command = &quot;$mailprog -f $hdr $recipient&quot;;<br><br># open a pipe to the sendmail program<br>open (MAIL, &quot;¦$command&quot;) ¦¦ die &quot;Can't open $mailprog!\n&quot;;<br>print MAIL &quot;From: Someone Relevant\n&quot;;<br>print MAIL &quot;Reply-To: \n&quot;;<br>print MAIL &quot;Subject: Subject of Message.\n&quot;;<br>print MAIL &quot;Precedence: bulk\n\n&quot;;<br>print MAIL &quot;--------------------------------------------------------------\n&quot;;<br>print MAIL &quot;Some content for the message\n\n&quot;;<br>foreach $error (@errors) { print MAIL &quot;$error\n&quot;; }<br># Send mail to Recipient<br>close MAIL;<br></font> <p> <br><a href=mailto: > </a><br><a href= > </a><br> keep the rudder amid ship and beware the odd typo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top