logo       

Perl and HTML: msg#00423

perl-beginners

Subject: Perl and HTML

I am using Perl 5.8.x, Windows XP SP2 and Novell GroupWise email client. 
I have written a program to send an email which contains HTML.  Issue is that
in the email body the 'body' shows up as HTML text and GroupWise has the choice
to read it in HTML grayed-out (for this email only).  In other words, I get no
processed HTML just the HTML text and I can not choose to read it in HTML (btw
- have no such issue with other emails from other sources containg HTML.  I can
choose to read it in HTML via GroupWise w/o issues).

Question:  How do I send a email containing HTML that can be read/processed by
GroupWise as HTML?

Test code snippet:

#!/usr/bin/perl

my $mailBody;

sub do_html() {
  $mailBody = <<ENDHTML;
  <!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
  <HTML>
   <HEAD>
      <TITLE>
        Hello         
      </TITLE>
   </HEAD>
  <BODY>
     <H1>Hi</H1>
     <P>"hello world" HTML document.</P>
  </BODY>
  </HTML>
ENDHTML
}

sub do_email() {
  use Net::SMTP;
  my $Smtp;
  
  $Smtp = Net::SMTP->new("smtp.server.net") or die "Unable to connect to email
server: $!"; 
  $Smtp->mail("bob\@yahoo.com");     
  $Smtp->to("bill\@yahoo.com");        
  $Smtp->data();                                   
  .
  $Smtp->datasend("From: ("bob\@yahoo.com"\n");
  $Smtp->datasend("To:("bill\@yahoo.com"");
  $Smtp->datasend("Subject: test HTML message\n");
  $Smtp->datasend("\n");

  $Smtp->datasend($mailBody);        
  $Smtp->dataend();                   
  $Smtp->quit;                       
}

  do_html();
  do_email();
  exit;



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | Mail Home | sitemap | FAQ | advertise