RajNaidu has asked for the wisdom of the Perl Monks concerning the following question:

How do I send html file content thru mail in perl ? Any help is appreciated

Replies are listed 'Best First'.
Re: to send html file content thru mail
by marto (Cardinal) on Feb 02, 2010 at 07:22 UTC

    Check out MIME::Lite, the documentation contains examples of doing this.

Re: to send html file content thru mail
by ikegami (Patriarch) on Feb 02, 2010 at 03:40 UTC
    Instead of specifying text/plain as the type of the body, specify text/html

      I have specified as follows. my $SUBJECT="hello\n"; print "Subject: $SUBJECT"; print "MIME-Version-1.0"; print "Content-type: text/html", "\n\n"; print "Content-Disposition: inline";

        my $SUBJECT="hello\n"; print "Subject: $SUBJECT"; print "MIME-Version-1.0"; print "Content-type: text/html", "\n\n"; ### THIS IS WRONG print "Content-Disposition: inline";
        As soon as you enter a blank line everything else is viewed as content. Only enter an empty line once at the end of headers. Or, if you are unsure of the MIME standard (or indeed in a hurry), let a module take care of all that for you, http://search.cpan.org/~bbc/Email-MIME-CreateHTML-1.026/lib/Email/MIME/CreateHTML.pm looks like it might do the business for you.

        By the way, did you notice that providing your code facilitated a useful answer, if you need help always show what you have tried.</snark>

        print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."