From: Dimitar Petrov 

  Hello Thag,

  I think plugin is the wrong approach here. Plugins seemed to be good idea in 
the past, but now they are recommended only if you mess with the internals.
  I think the recommended think to send emails within Catalyst application is 

  a) or
  b) create a separe model, like shown here


  As Chromatic said in that article in, it is a good idea 
to create a standalone script that can send email because it can work in 
Catalyst apps, and can also work in standalone scripts ran manually or by cron 
jobs. It can also work with job queues.

  The module from that article uses Mail::Builder::Simple which can be simply 
used with something like:

       use Mail::Builder::Simple;

       my $mail = Mail::Builder::Simple->new;

        from => '',
        to => '',
        subject => 'The subject with UTF-8 chars',
        plaintext => "Hello,\n\nHow are you?\n",

  Mail::Builder::Simple sets the MIME headers automaticly and also encodes the 
MIME headers and the HTML and text body of the messages to UTF-8.

  If you know that you'll never want to send email with a program outside the 
Catalyst app, you can use Mail::Builder::Simple easier by installing
  and create a model for sending email with it, using something like:

   ./script/ model MyMailer Email SMTP usr passwd

  And then you can send email with it using something like:

     from => '',
     to => '',
     subject => 'The subject with UTF-8 chars',
     plaintext => "Hello\n\nHow are you?\n\n",

  For more info:


Searchable archive:
Dev site:

Reply via email to