Showing posts with label perl module. Show all posts
Showing posts with label perl module. Show all posts

Tuesday, June 10, 2008

Net::SMTP::TLS

For no apparent reason, I poked around mail client setup for gmail last night and I found it mentioned STARTTLS on their SMTP setup. Several month ago I didn't find any working Perl module to send email via google, so I decided to conduct a little search again using that keyword.

Enter Net::SMTP::TLS.
use Net::SMTP::TLS;
my $mailer = new Net::SMTP::TLS(
'smtp.gmail.com',
Hello => 'gmail.com',
Port => 587,
User => 'tracelogger@gmail.com',
Password=> 'pwd',
Timeout => 10,
Debug => 1,
);
$mailer->mail('tracelogger@gmail.com');
$mailer->to('anybody@world.com');
$mailer->data;
$mailer->datasend("To: anybody\@world.com\n");
$mailer->datasend("\n");
$mailer->datasend("Sent thru TLS!");
$mailer->dataend;
$mailer->quit;

Wednesday, December 5, 2007

PerlIO-GZip Is Broken

Found a problem with PerlIO-GZip module (v0.17) with ActiveState Perl 5.8.4 + Win2K, apparent it doesn't gunzip a compressed file properly. At first, I suspected a bad gzip file. But the files, extracted using Winzip and GNUWin32 gunzip, are good, so I believe this is a problem with the module.

I will investigate a little more and send the artifacts once I am done with the eDoc scripts.

Currently I extract the files using GNUWin32 gunzip utility and pass the content to STDOUT for parsing.
gunzip.exe -c CompressedFile.gz