NAME

DTS::Task::SendEmail - a subclass of DTS::Task that represents a DTSSendMailTask object.

SYNOPSIS

use warnings;
use strict;
use DTS::Application;
use Test::More;
use XML::Simple;

my $xml    = XML::Simple->new();
my $config = $xml->XMLin('test-config.xml');

my $app = DTS::Application->new( $config->{credential} );

my $package = $app->get_db_package(
    {
        id               => '',
        version_id       => '',
        name             => $config->{package},
        package_password => ''
    }
);

foreach my $send_mail ( @{ $package->get_send_emails } ) {

    print $send_mail->to_string, "\n";

}

DESCRIPTION

DTS::Task::SendEmail represents a DTS SendMail task object.

EXPORT

None by default.

METHODS

All methods from DTS::Task are also available.

is_nt_service

Returns true or false (1 or 0) whether the caller is a Microsoft Windows NT 4.0 or Microsoft Windows 2000 Service. Returns true only if the program that calls the package Execute method is installed as a Windows NT 4.0 or Windows 2000 Service.

save_sent

Returns true or false (1 or 0) whether to save outgoing e-mail messages in the Sent Items folder.

get_message_text

Returns a string with the message text defined, including new line characters.

get_cc_line

Returns a string with the email addresses included in the CC field of the email. Email are separated by semicolons.

get_attachments

Returns the complete pathname and filename of the attachments, separated by semicolons.

get_profile_password

Returns a string with the defined profile password, if used.

get_profile

Returns a string with the profile being used to send the email.

get_subject

Returns a string with the subject of the email

get_to_line

Returns a string with all email addresses defined in the To field of the email. Addresses are separated by semicolon characters.

get_properties

Returns an array reference. The values are returned in the following order below:

0 is_nt_service
1 save_sent
2 message_text
3 cc_line
4 attachments
5 profile_password
6 profile
7 subject
8 to_line

SEE ALSO

  • Win32::OLE at perldoc.

  • MSDN on Microsoft website and MS SQL Server 2000 Books Online are a reference about using DTS' object hierarchy, but one will need to convert examples written in VBScript to Perl code.

AUTHOR

Alceu Rodrigues de Freitas Junior, <glasswalk3r@yahoo.com.br>

COPYRIGHT AND LICENSE

Copyright (C) 2006 by Alceu Rodrigues de Freitas Junior

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.