From Code to Community: Sponsoring The Perl and Raku Conference 2025 Learn more

NAME

SysAdmin::SMTP - Perl Net::SMTP class wrapper module.

SYNOPSIS

my $smtp_object = new SysAdmin::SMTP(server => "localhost");
my $from_address = qq("Test User" <test_user\@test.com>);
my $subject = "Test Subject";
my $message_body = "Test Message";
my $email_recipients = ["test_receiver\@test.com"];
$smtp_object->sendEmail(from => $from_address,
to => $email_recipients,
subject => $subject,
body => $message_body);

DESCRIPTION

This is a sub class of SysAdmin. It was created to harness Perl Objects and keep code abstraction to a minimum.

SysAdmin::SMTP uses Net::SMTP, MIME::Lite to send emails.

METHODS

new()

my $smtp_object = new SysAdmin::SMTP(server => "localhost");

Declare the SysAdmin::SMTP object instance. Takes the SMTP server as the only variable to use.

sendEmail()

my $from_address = qq("Test User" <test_user\@test.com>);
my $subject = "Test Subject";
my $message_body = "Test Message";
my $email_recipients = ["test_receiver\@test.com"];
$smtp_object->sendEmail(from => $from_address,
to => $email_recipients,
subject => $subject,
body => $message_body);

SEE ALSO

Net::SMTP - Simple Mail Transfer Protocol Client

MIME::Lite - low-calorie MIME generator

AUTHOR

Miguel A. Rivera

COPYRIGHT AND LICENSE

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.