Newsletter

Newsletter Simple in use:

#!/usr/bin/perl -w
use strict;
use Newsletter;

my $news = Newsletter->new;

$news->template( path => '/tmp/newsletter' );

$news->template( 
	file => {
		# u need
		path => 'test/myHeader.html',
		type => 'html',
		is => 'header',

		# here starts the optional Params
		name => 'My Header Name',
		schema => 'My First Template',
		embedded => '/tmp/opera.jpg'

		# here starts self defined Params
		# ...
	}
);

$news->template(
	use => {
		schema => 'My First Template'
	}
);

$news->template(
        use => {
		is => 'header',
                name => 'My Header Name'
        }
);

$news->template(
        use => {
                is => 'header',
                filename => 'myHeader.txt'
        }
);

#print $news->template(
#        use => {
#                is => 'header',
#                filename => 'myHeader.html'
#        },
#	remove => 1
#);


#print $news->{'senderHeader'}->{'HTML'}, "\n";


#######################################################
# TEST List
#######################################################

$news->list(
	path => '/tmp/newsletter/list'
);

$news->list(
	list => {
		name => 'the-top@foo.bar'
	}
);

$news->list(
      	member => {
		# u need
		listname => 'the-top@foo.bar',
		mail => 'foo@bar.bla'
	}
);

$news->list(
        member => {
                # u need
                listname => 'the-top@foo.bar',
                mail => 'hello@world.bla'
        }
);

$news->list(
        remove => {
		# remove one member
                listname => 'the-top@foo.bar',
                mail => 'hello@world.bla'
        }
);

$news->list(
        remove => {
		# remove whole list
                listname => 'the-top@foo.bar',
        }
);


############################################
# Test Send
############################################

$news->list(
	empty => 1,
        path => '/tmp/newsletter/list'
);

$news->list(
        list => {
                name => 'news@vienna-marathon.com',
        }
);

$news->list(
        member => {
                # u need
                listname => 'news@vienna-marathon.com',
                mail => 'dominik@soft.uni-linz.ac.at'
        }
);

$news->body(
	path => '/tmp/newsletter/body'
);

$news->body(
	subject => 'A test mail!',
	file => {
		path => 'test/myBody.html',
		type => 'html',
		embedded => '/tmp/opera.jpg'
	}	
); 

$news->body(
        file => {
                path => 'test/myBody.txt',
                type => 'text',
        }
);


$news->sender(
        smtp => 'soft.uni-linz.ac.at'
);

my $sender = $news->buildMail();

#print $sender->as_string;
#print "\n";

$news->send();






INSTALLATION

To install this module, run the following commands:

    perl Makefile.PL
    make
    make test
    make install


SUPPORT AND DOCUMENTATION

After installing, you can find documentation for this module with the perldoc command.

    perldoc Newsletter

You can also look for information at:

    Search CPAN
        http://search.cpan.org/dist/Newsletter

    CPAN Request Tracker:
        http://rt.cpan.org/NoAuth/Bugs.html?Dist=Newsletter

    AnnoCPAN, annotated CPAN documentation:
        http://annocpan.org/dist/Newsletter

    CPAN Ratings:
        http://cpanratings.perl.org/d/Newsletter

COPYRIGHT AND LICENCE

Copyright (C) 2006 Dominik Hochreiter

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
