From:                   "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> Here's my code
> sorry its long!
> its for trouble ticket express
> 
> package TTXMail;

Forget this an use a higher level module than Net::SMTP!
MIME::Lite should make your life much easier, and will still give you 
the option to use an external mailer or SMTP as requested by the 
config.
 
> use strict;
> use TTXData;
> use TTXMarkup;
> my $hasb64 = 1;
> $hasb64 = 0 unless eval "require MIME::Base64";

MIME::Base64 is included with Perl since 5.007003 and CAN be 
installed on any perl all the way back to versions that are so dated 
that noone should even think about using them. Why do you think you 
need to do this?
 
> my $mailer;
> my $smtphost;
> my $usesmtp;
> 
> my $CRLF    = "\015\012";
> my $doemailfix = 0;
> 
> #
> =======================================================================
> encode
> 
> sub encode {
>   return $_[0] if $_[0] !~ /[^a-zA-Z0-9 ()[\]_!\/\\{}"';:?<>@#\$%&*\n
> \r.,-]/;
>   return "=?ISO-8859-1?B?".base64($_[0], "")."?=" if !$_[1];
>   my $adr = $_[0];
>   $adr =~ s/"[^"]*"//;
>   $adr =~ s/^[^<]*<//g;
>   $adr =~ s/>[^>]*$//g;
>   $adr =~ s/^\s+//;
>   $adr =~ s/\s+$//;

Let me show you a trick:

   for ($adr) {
     s/"[^"]*"//;
     s/^[^<]*<//g;
     s/>[^>]*$//g;
     s/^\s+//;
     s/\s+$//;
   }

And if you need to do the same transformations to several variables, 
just put them all into the for(list).

Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to