SysAdmin::SMTP - Perl Net::SMTP class wrapper module.
use SysAdmin::SMTP; 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);
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.
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);
Net::SMTP - Simple Mail Transfer Protocol Client
MIME::Lite - low-calorie MIME generator
Miguel A. Rivera
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.
To install SysAdmin, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SysAdmin
CPAN shell
perl -MCPAN -e shell install SysAdmin
For more information on module installation, please visit the detailed CPAN module installation guide.