NAME

App::Basis::Email

SYNOPSIS

    use Text::Markdown qw(markdown);
    use App::Basis::Email ;

    my $markdown = <<EOD ;
    # Basic Markdown

    ![BBC Logo](http://static.bbci.co.uk/frameworks/barlesque/2.60.6/orb/4/img/bbc-blocks-light.png)

    That was an inlined image

    ## level2 header

    * bullet
        * sub-bullet

    ### level3 header

    EOD
    my $html = markdown($markdown);

    my $mail = App::Basis::Email->new( hostname => 'my.email.server', port => 25 ) ;
    my $status = $mail->send(
        from    => 'fred@fred.test.fred',
        to      => 'fred@fred.test.fred',
        subject => 'test HTML email, with inline images',
        html    => $html
    );

DESCRIPTION

Sending email should be simple, sending formatted email should be simple too. I just want to be able to say send this thing via this process.

This module provides that, a way to simply send email (plain/html or markdown) via either a SMTP or sendmail target.

Obviously I do nothing new, just wrap around existing modules, to make life simple.

AUTHOR

kevin mulholland

Notes

if you want templating then do it outside of this module and pass the formatted HTML/markdown in

See Also

To create email I use Email::MIME::CreateHTML, you may need to force this to install it as there is a slight test bug To send email I use Email::Sender::Simple with Email::Sender::Transport::SMTP and Email::Sender::Transport::Sendmail Markdown processing is done with Text::Markdown

new

Create a new instance of the email

    my $mail = App::Basis::Email->new( host => "email.server.fred", port => 25 );

Parameters host ip address or hotsname of your SMTP server port optional port number for SMTP, defaults to 25 ssl use SSL mode user user for ssl passwd password for ssl testing flag to show testing mode, prevents sending of email

send

send the required email

    my $mail = App::Basis::Email->new( hostname => 'my.email.server', port => 25 ) ;
    my $status = $mail->send(
        from    => 'fred@fred.test.fred',
        to      => 'fred@fred.test.fred',
        subject => 'test HTML email, with inline images',
        html    => $html
    );

Any data that is in the hash is passed to the server, though some may be re-interpreted as mentioned in the DESCRIPTION

Parameters to email address to (can be array of email addresses) cc email cc list (can be array of email addresses) from email address from subject subject for the email text teset message to send, for email clients that do not do html html html message to send markdown markdown message to send, converted to html and replaces it css_file link to a css file to use for HTML/markdown files

Returns status - true = Sent, false = Failed (string of email message if testing flag used)