[Catalyst] Requesting example code for postfix and Email::Sender

will trillich will.trillich at serensoft.com
Mon Mar 21 18:37:05 GMT 2011


You're probably overthinking this. :)

Whether it's postfix or exim or any other daemon really shouldn't matter.
Your code will connect to SMTP server "localhost" on port "25". If you can
send an email from the command line (via 'mutt' or 'mail' etc) then you
should be ready to go:

First

$ *script/myapp_create.pl view Email Email*

Then

#myapp.conf
<View::Email>
    stash_key        =3D *email*
    <default>
        content_type =3D text/plain
        charset      =3D utf-8
    </default>
</View::Email>

Then in a controller...

$c->stash->{*email*} =3D {
    from       =3D> $c->config->{email_from},
    'reply-to' =3D> $c->user->email_name,
    to         =3D> $c->user->email_name,
    cc         =3D> join(',', @cc),
    subject    =3D> $subj,
    body       =3D> $message,
};
$c->forward( $c->view('Email') );

Note on the manpage (below) that it will default to LOCALHOST and SMTP
unless you specify otherwise
http://search.cpan.org/~dhoss/Catalyst-View-Email-0.31/lib/Catalyst/View/Em=
ail.pm


On Mon, Mar 21, 2011 at 6:17 PM, Kutbuddin Doctor <
ksdoctor at sanfordburnham.org> wrote:

> I am looking for an example of how to configure catalyst to use postfix on
> localhost to send email (mostly application notifications) via catalyst.
>
> And especially example code from someone who has done this successfully. I
> have seen several recommendations for using Email::Sender with catalyst b=
ut
> no examples of how to do this with postfix running locally. All of the
> Transport examples are either SMTP or sendmail. The rest of
> Email::Sender::Transport CPAN documentation is very sparse.
>
> Thanks for the help!
>
> cheers,
> Kutbuddin
>
> --
>
>
>
>
>
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>



-- =

11 cheers for binary!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20110321/b8a68=
0fc/attachment.htm


More information about the Catalyst mailing list