Snippet details
ID: 110
Viewed: 1453
Added: 2002-04-04
Version:
A basic way to send email as html in perl. Can also be setup to read from a form.
General Details
Snippet uploaded by: snippet
Email : webmaster@snippetlibrary.com
Snippet By: snippet
<!---Head--->
$mail_prog = '/usr/sbin/sendmail' ;
$email = "your@address.com";
$to = "recipient@addrerss.com";
$subject = "emails subject";
$body = "<html><head></head><body>your text here</body></html>";
<!---Body--->
open(MAIL, "| $mail_prog -t") || &error("Could not send out emails");
print MAIL "To: $to n";
print MAIL "From: $email <$email>n";
print MAIL "Subject: $subjectn";
print MAIL "MIME-Version: 1.0n";
print MAIL "Content-Type: text/html;n";
print MAIL "Content-Transfer-Encoding: 7bitnn";
print MAIL "$body"; //your html starts here.
print MAIL "nn";
print MAIL "nn";
close (MAIL);
No Reviews to show
