NAME

DADA::Mail::Send


SYNOPSIS

        use DADA::Mail::Send
        my $mh = DADA::Mail::Send->new;

Mail Routines for the Dada Mail MLM, UC?


DESCRIPTION

Cool name huh? You have found the heart of the beast, this is where ALL mailings will find themselves, one way or another, let's see if we can get this all straightened out so you can customize this to your heart's delight. Follow me...

First off, there are TWO different ways mailings happen, either by sending one e-mail, using the send() method, or when sending to a group, using the bulk_send() method. This is somewhat of a fib, since mailings called by bulk_send() actually use the send() method to do its dirty work. Well, that is, if you're not using a SMTP feature, then both the send() and bulk_send() have their own way of doing it... kinda.

DADA::Mail::Send uses the Mail::Bulkmail CPAN module, written by James A Thomason III (thomasoniii@yahoo.com) for ALL its SMTP services. And we pretty much love him for that.

PLEASE NOTE That the version of Mail::Bulkmail.pm provided in this distribution IS NOT the same version as is on CPAN, the version in this distribution has 2 bug fixes, one relating to having the correct date applied to messages, the other relating to the fact that there are top level domains with more than 3 letters in 'em.

You create a single address object like so:

        my $mh = DADA::Mail::Send->new(\%list_info); 
        my %mailing = (
        To       => 'justin@skazat.com', 
        From     => 'alex@prolix.nu', 
        Subject  => 'party over here!', 
        Body     => 'yo yo yo, wheres the flava at? we need some action!', 
        ); 
        $mh->bulk_send(%mailing);

Pretty fricken hard eh? Well, it can get a bit harder than that, but thats a pretty stripped down version, If you wanted, you could theoretically use this as a do all mail sender + all the features that are in the Guts.pm module. Its pretty easy to make some crazy... stuff once you've got a handle on it.


new

 my $mh = DADA::Mail::Send->new(-list => $list_info_hashref);


Default Headers

DADA::Mail::Send has a wide variety of both e-mail headers you can send to it. you do this through either the send() or bulksend() methods


Handy Dandy Methods

These methods are used to change how Dada Mail sends mostly Bulk messages, these are the fun ones,

return_headers

        my %headers = $mh->return_headers($string);

This is a funky little subroutine that'll take a string that holds the header of a mail message, and gives you back a hash of all the headers separated, each key in the hash holds a different header, so if I say

        my $mh = DADA::Mail::Send -> new(); 
        my %headers = $mh -> return_headers($header_glob);

I can then say:

        my $to = $headers{To};

This subroutine is used quite a bit to take out put from the MIME::Lite module, which allows you to get the whole header with its header_to_string() subroutine and hack it up into something Dada Mail can use.

clean_headers

        %squeaky_clean_headers = $mh->clean_headers(%these_be_the_heaers);

this method does a little munging to the mail headers for better absorbtion; basically, it changes the case of some of the mail headers so everyone's on the same page

send

This method sends an email, it takes a hash of the mail headers, plus the body of the message:

$mh->send(To => 'justin@skazat.com',
From => 'secret@admirer.com',
Subject => 'smooch!',
Body => 'you are so cute, you little Perl Coder you'
);

bulk_send

Sends a message to everyone on your list, (that you specified, by passing a hash ref with the list settings.. right?)

Takes the same arguments as send()

returns (for now) the Message-ID of the message being sent.

You can use this as the key for an archived message (let's say)

_make_general_headers

(private)

return a hash containing:


COPYRIGHT

Copyright (c) 1999 - 2005 Justin Simoni me@justinsimoni.com http://justinsimoni.com All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.