RE: [Catalyst] Sending email from a Catalyst app

2008-07-21 Thread Hartmaier Alexander

***
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
***
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then 
delete this e-mail immediately.
***---BeginMessage---
winmail.dat---End Message---
___
List: Catalyst@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/


Re: [Catalyst] Sending email from a Catalyst app

2008-07-03 Thread Gerda Shank

ivorw wrote:

The only trouble is I'm struggling to get it working. Using Sendmail as
the mailer sends the mail out - I receive it no problem, but the
application gets an exception error when closing pipe to
/usr/bin/sendmail. No child processes ...

  
I see that you have moved on to other packages, but just thought that 
I'd mention that I got this error executing a Perl system call using the 
development server because Catalyst::Engine::HTTP contains:

local $SIG{CHLD} = 'IGNORE';

Commenting this line out makes the error go away. I have no idea if 
there are other downstream issues. But the non-development servers don't 
do this, so you won't get the error there.


Gerda


___
List: Catalyst@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/


Re: [Catalyst] Sending email from a Catalyst app

2008-07-02 Thread Moritz Onken

Am 02.07.2008 um 12:09 schrieb ivorw:


I know there's more than one way to do this. I'm looking at what the
best practice is.

I've had some success inthe past with Catalyst::Plugin::Email, but I'm
now looking at Catalyst::View::Email[::Template] which seems  
altogether

much cleaner, able to be controlled from the config.





Does C::P::Email work on that machine?
Did you try to telnet your machine and send a mail via the command line?

greetings,

moritz


___
List: Catalyst@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/


Re: [Catalyst] Sending email from a Catalyst app

2008-07-02 Thread Octavian Rasnita
From: ivorw [EMAIL PROTECTED]
I know there's more than one way to do this. I'm looking at what the
 best practice is.
 
 I've had some success inthe past with Catalyst::Plugin::Email, but I'm
 now looking at Catalyst::View::Email[::Template] which seems altogether
 much cleaner, able to be controlled from the config.
 

A more cleaner and better solution is to use Mail::Sender::Easy.

You can create UTF-8 encoded messages, include attachments, inline images, 
create messages with a text and an html part, and if you use MIME::Words you 
can also use special chars in To, From and Subject fields or other headers.

You can do:

use Mail::Sender::Easy qw(email);
use MIME::Words qw(:all);

email({
fromaddr = '[EMAIL PROTECTED]',
from = 'My Name [EMAIL PROTECTED]',
toaddr = '[EMAIL PROTECTED]',
to = encode_mimewords('Your Name with special chars [EMAIL PROTECTED]', 
Charset = UTF-8),
subject = 'The subject',
smtp = '127.0.0.1',

#auth = 'LOGIN',
#authid = user,
#authpwd = password,
#skip_bad_recipients = 1,

_text = 'The text body',
_html = 'The bhtml/b body',
_text_info = {charset = UTF-8},
_html_info = {charset = UTF-8},

#priority = 2, # 1-5 high to low
#confirm = 'delivery, reading',

_attachments = {
  'smiley.gif' = {
_disptype = 'GIF Image',
_inline = 'smile1',
description = 'Smiley',
ctype = 'image/gif',
file = '/home/foo/images/smiley.gif',
  },
  'mydata.pdf' = {
description = 'Data Sheet',  
ctype = 'application/pdf',
msg = 'message',
  },
},
}) or die $@;

It would be also nice a Catalyst::Plugin::Mail or Catalyst::View::Mail that 
uses Mail::Sender::Easy and MIME::Words, but using those modules directly is 
very easy and doesn't require writing much code anyway.

And of course, Mail::Sender::Easy offers much many options than those shown.

Octavian


___
List: Catalyst@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/


Re: [Catalyst] Sending email from a Catalyst app

2008-07-02 Thread Bernhard Graf
ivorw wrote:

 I know there's more than one way to do this. I'm looking at what the
 best practice is.

 I've had some success inthe past with Catalyst::Plugin::Email, but
 I'm now looking at Catalyst::View::Email[::Template] which seems
 altogether much cleaner, able to be controlled from the config.

Catalyst::View::Email is broken, see
http://lists.scsys.co.uk/pipermail/catalyst/2008-January/016658.html
and the replies.
-- 
Bernhard Graf

___
List: Catalyst@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/


Re: [Catalyst] Sending email from a Catalyst app

2008-07-02 Thread ivorw
Bernhard Graf wrote:
 Catalyst::View::Email is broken, see
 http://lists.scsys.co.uk/pipermail/catalyst/2008-January/016658.html
 and the replies.
   
Thank you for pointing me to that thread of discussion. I can now see
that my original impression of C::V::E as being a cleaner interface, was
wrong. I'll go back to using C::P::E

Cheers,

Ivor.

___
List: Catalyst@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/