The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

App::OpenMbox::Client - A perl client to send simple email via OpenMbox's smtp server

VERSION

Version 0.13

SYNOPSIS

This module can send simple email via smtp server provided by OpenMbox or any others.

Before installation you should have Net::SSLeay pre-installed, which can be fetched by this way on Ubuntu.

    sudo apt install libnet-ssleay-perl

You can send email with OpenMbox's smtp server, which accepts smtp connection on port 587. Also you can use other provider's smtp servers, for example, gmail, pobox etc. They generally require connection to port 465 with SSL enabled.

    use App::OpenMbox::Client;

    my $client = App::OpenMbox::Client->new('user@openmbox.net','some.pass');

    # sending a plain text
    $client->sendmail(recepients => 'xx@a.com,xx@b.com',
                      type => 'text/plain',
                      subject => 'greetings',
                      body => 'how are you doing today?',
                     );

    # sending a jpeg image
    $client->sendmail(recepients => 'xx@a.com,xx@b.com',
                      type => 'image/jpeg',
                      subject => 'a picture',
                      path => '/tmp/aaa.jpeg',
                     );

    # sending with pobox's smtp server
    my $client = App::OpenMbox::Client->new('user@pobox.com','some.pass');

    $client->sendmail(recepients => 'xx@a.com,xx@b.com',
                      host => 'smtp.pobox.com',
                      port => 465,
                      ssl  => 1,
                      debug => 1,
                      type => 'text/plain',
                      subject => 'hello',
                      body => 'how are you!',
                     );

EXPORT

SUBROUTINES/METHODS

new

New the instance by providing email account and password.

sendmail

Send email with specified arguments. The argument names can be,

    recepients - the recepient addresses, multi-ones splitted by ","
    host - smtp host, optional, default to 'mail.openmbox.net'
    port - smtp port, optional, default to 587
    ssl - optional, default 0 for non-SSL connection
    debug - optional, default 0 for no debug mode
    type - mime type such as text/plain, text/html etc, see MIME::Lite
    subject - message subject
    body - message body
    path - path to get the attachment such as 'image/jpeg'
    

AUTHOR

Henry R, <support at openmbox.net>

BUGS

Please report any bugs or feature requests to bug-app-openmbox-client at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=App-OpenMbox-Client. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc App::OpenMbox::Client

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

This software is Copyright (c) 2022 by Henry R.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)