Posted on 2009-01-12 13:14:12-08 by arfreitas
Test::Reporter::Transport::Outlook

Greetings,

I'm a ActivePerl user and in my job I'm not able to connect externally to a SMTP server and authentication against an Exchange server is not that simple.

What is simple is to use Outlook to send the email message. I created a module to do that and looks like it works fine, althought I'm still not able to define customized headers (like the one that defines the tool used to report the test) because of limitations of Outlook (that looks like can be fixed by using a DLL called Redemption).

I would like to know if it would be interesting to publish this module and, if it is, how problematic would not sending the customized header.

The code is quite simple and follows below:

use strict; use warnings; package Test::Reporter::Transport::Outlook; use base 'Test::Reporter::Transport'; use vars qw/$VERSION/; use Mail::Outlook; $VERSION = '0.01'; $VERSION = eval $VERSION; sub new { my $class = shift; my $self = { _outlook => Mail::Outlook->new() }; return bless $self, $class; } sub get_outlook { my $self = shift; return $self->{_outlook}; } sub send { my ( $self, $report ) = @_; my $message = $self->get_outlook()->create(); $message->To( $report->address() ); $message->Subject( $report->subject() ); $message->Body( $report->report() ); $message->display(); return; } 1; __END__

Regards,

Alceu

Direct Responses: 9709 | Write a response
Posted on 2009-01-12 16:20:18-08 by dagolden in response to 9705
Re: Test::Reporter::Transport::Outlook

Hi, Alceu. The idea behind Test::Reporter::Transport was to open it up to people to figure out new ways to send reports.

I think it would be great for you to publish your module on CPAN. From the display() call, I assume it pops up the message for the user to click "send"? You might want to note that in the documentation so that someone using it and testing a module with a lot of dependencies isn't shocked to find a dozen or more mail windows opening up.

If you've got further ideas, I encourage you to subscribe to cpan-testers-discuss@perl.org (send an email to cpan-testers-discuss-subscribe@perl.org) and continue the conversation there, as you'll probably get the attention of more people. (Also, Barbie, who wrote Mail::Outlook, is one of the CPAN Testers leaders and may be interested.)

-- David

Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.