snippet library logo
in category
Perl / Email / Sending email as Html
Snippet details
ID: 110
Viewed: 1453
Added: 2002-04-04
Version:

User Rated at:
Rate This:
Snippets in this catagory         
Show Printable 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


Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.


Subject:

Reviewed By:

Write a review:





Terms of Conditions
Powered By
Avian Hosting
© 2005 snippetlibrary.com All Rights Reserved.