[Catalyst] C::V::Email::Template - "no sender" error
Oleg Kostyuk
cub.uanic at gmail.com
Sat Jul 31 04:10:21 GMT 2010
This is part of example from Catalyst::View::Email::Template:
=========================================
$c->stash->{email} = {
to => 'jshirley at gmail.com',
cc => 'abraxxa at cpan.org',
bcc => 'hidden at secret.com hidden2 at foobar.com',
from => 'no-reply at foobar.com',
..................
=========================================
Your stash have "to" key/value pair, but don't have "from".
Also:
# grep -nr 'no sender' /usr/**/perl/
/usr/local/share/perl/5.10.1/Email/Sender/Manual/QuickStart.pm:67:those
fields. Similarly, if no sender is specified, it will use the first
/usr/local/share/perl/5.10.1/Email/Sender/Simple.pm:106:
Email::Sender::Failure::Permanent->throw("no sender") if ! defined
$from;
HTH
2010/7/30 Ollie <catalyst at kwaping.com>:
>
> Hi everyone,
>
> I'm new here, forgive my transgressions. I'm having an issue with
> Catalyst::View::Email::Template. I've posted the full details to
> perlmonks.org hoping to get a quick answer, but nothing yet. Here is a link
> to the posting:
>
> http://perlmonks.org/?node_id=852027
>
> I will copy the text of the posting for your convenience, though the
> formatting might suffer.
>
> For future reference, is the PM link enough or should I continue to post the
> full text for the archives?
>
> Thanks in advance!
>
> -Ollie
>
>
> ===
> I keep getting a "no sender" error when trying to send email via
> Catalyst::View::Email::Template. I'm pretty sure it's some sort of config
> error, but I have tried everything I can think of with no resolution. Please
> take a gander at my config and code and tell me what you think I should do.
> Thanks!
>
> Here's the code that sends the email:
>
> my $to = $user->email;
> $c->stash->{email_out} = {
> to => $to,
> subject => "XXX.com Membership Activation ($enc_string)",
> template => 'activation.tt',
> };
>
> $c->forward($c->view('Email::Template'));
>
> if (not scalar @{$c->error}) {
> $c->log->debug("*** Email sent! $to ($enc_string) ***");
> }
>
>> From MyApp.pm (not its real name, but the equivalent):
>
> __PACKAGE__->config->{'View::Email::Template'} = {
> template_prefix => 'emails',
> stash_key => 'email_out',
> default => {
> view => 'TT',
> content_type => 'text/plain',
> charset => 'utf-8',
> },
> sender => {
> mailer => 'SMTP',
> mailer_args => {
> host => 'mail.<mydomain>.com',
> sasl_username => '<email address here>',
> sasl_password => '<email password here>',
> ssl => 1,
> }
> },
> };
>
> I have no config for View::Email because I don't plan on sending any
> non-templated emails. I've tried it with and without, no change. I also have
> no config directly in either my View::Email or View::Email::Template
> modules. I tried putting some in there but it didn't resolve the issue.
> Here's some of the debug output from Catalyst:
>
> [debug] Path is "send_activation_email"
> [debug] Arguments are "<username goes here>"
> [debug] *** Manually sending activation email ***
> [debug] *** Sending activation email ***
> [debug] *** Found existing activation, 3 ***
> [debug] C::V::Email::Template uses default view
> XXX::View::TT=HASH(0x10238e1c0) for rendering.
> [debug] C::V::Email uses default content_type text/plain.
> [debug] Rendering template "emails/activation.tt"
> [debug] C::V::Email uses specified content_type text/plain.
> [error] no sender
>
> I will post more debug output upon request, but there's nothing in there
> that appears useful, to my eyes.
> ===
>
> _______________________________________________
> 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/
>
--
Sincerely yours,
Oleg Kostyuk (CUB-UANIC)
More information about the Catalyst
mailing list