Getting perl to email via sendmail/postfix

Lance F. Squire lance-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org
Thu Jul 29 16:24:48 UTC 2004


A variation on this should do:


#Send Thankyou letter to User

#The location of sendmail
$sendmail = "/usr/sbin/sendmail -t";

#Subject
$Subject="Thank you for Registering";

# Send the Message
open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!";
  #Headers go here
  #
  print SENDMAIL "From: script\@someplace\n";
  print SENDMAIL "To: $Recipient\n";

  print SENDMAIL "Subject: $Subject\n";
# print SENDMAIL "Content-Type: multipart/mixed\; 
boundary=\"$boundary\"\n\n";
# print SENDMAIL "--$boundary\n";

  #The body of the e-mail goes here
  #
  print SENDMAIL "Content-Type: text/plain;\n\n";
  #print SENDMAIL "Content-Type: text/html;\n\n";

  print SENDMAIL "$Message\n";

  close(SENDMAIL);

--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list