Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Perl / Getting Started / July 2009



Tip: Looking for answers? Try searching our database.

Perl and HTML

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tony Esposito - 31 Jul 2009 22:21 GMT
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;

     
Dermot - 31 Jul 2009 23:00 GMT
2009/7/31 Tony Esposito <tony1234567893@yahoo.co.uk>:
> 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).
[quoted text clipped - 26 lines]
> sub do_email() {
>   use Net::SMTP;

Take a look at MIME::Lite[1]. HTML emails are multi-part and as far I
know, that not Net::SMTP's game.
HTH,
Dp.

1) http://search.cpan.org/~rjbs/MIME-Lite-3.024/lib/MIME/Lite.pm

Signature

To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Tony Esposito - 31 Jul 2009 23:06 GMT
Thanks ... I'll give that a shot ... any other suggestions are welcomed ... thank again, Dermot.

________________________________
From: Dermot <paikkos@googlemail.com>
To: Tony Esposito <tony1234567893@yahoo.co.uk>
Cc: Beginners Perl <beginners@perl.org>
Sent: Friday, 31 July, 2009 17:00:45
Subject: Re: Perl and HTML

2009/7/31 Tony Esposito <tony1234567893@yahoo.co.uk>:
> 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).
[quoted text clipped - 26 lines]
> sub do_email() {
>   use Net::SMTP;

Take a look at MIME::Lite[1]. HTML emails are multi-part and as far I
know, that not Net::SMTP's game.
HTH,
Dp.

1) http://search.cpan.org/~rjbs/MIME-Lite-3.024/lib/MIME/Lite.pm

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

     
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.