Sending Mail

2002-06-13 Thread Jon Robison

Can anyone give me recommendations on a good Mail handler that
integrates well with mod_perl?

I have a system whereby I want to give people the ability to mail the
currently viewed page to someone. Once they select a To: address, the
system will look up some data, re-construct the viewed page in a textual
format, and send the mail.

I'm just looking for recommendations on a good perl mailing module for
this kind of use.

--Jon Robison



RE: Sending Mail

2002-06-13 Thread Joe Breeden

We use MIME::Lite seems to work well for us.

 -Original Message-
 From: Jon Robison [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, June 13, 2002 8:57 AM
 To: [EMAIL PROTECTED]
 Subject: Sending Mail
 
 
 Can anyone give me recommendations on a good Mail handler that
 integrates well with mod_perl?
 
 I have a system whereby I want to give people the ability to 
 mail the
 currently viewed page to someone. Once they select a To: address, the
 system will look up some data, re-construct the viewed page 
 in a textual
 format, and send the mail.
 
 I'm just looking for recommendations on a good perl mailing module for
 this kind of use.
 
 --Jon Robison
 



Re: Sending Mail

2002-06-13 Thread Jon Robison

Can MIME::Lite do attachments?

--Jon

Joe Breeden wrote:
 
 We use MIME::Lite seems to work well for us.
 
  -Original Message-
  From: Jon Robison [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, June 13, 2002 8:57 AM
  To: [EMAIL PROTECTED]
  Subject: Sending Mail
 
 
  Can anyone give me recommendations on a good Mail handler that
  integrates well with mod_perl?
 
  I have a system whereby I want to give people the ability to
  mail the
  currently viewed page to someone. Once they select a To: address, the
  system will look up some data, re-construct the viewed page
  in a textual
  format, and send the mail.
 
  I'm just looking for recommendations on a good perl mailing module for
  this kind of use.
 
  --Jon Robison
 



Re: Sending Mail

2002-06-13 Thread Geoffrey Young



Jon Robison wrote:

 Can MIME::Lite do attachments?
 


yes.  there is an example in the cookbook that uses MIME::Lite:

http://www.modperlcookbook.org/code/ch15/Cookbook/Mail.pm
http://www.modperlcookbook.org/code/ch15/Cookbook/EmailUploads.pm

HTH

--Geoff





Re: Sending Mail

2002-06-13 Thread fliptop

Jon Robison wrote:

 Can MIME::Lite do attachments?


yes, it can.  install it, then read

perldoc MIME::Lite

for info on how.




Re: Sending Mail

2002-06-13 Thread Doug Silver

I'm using Mail::Sender which can send attachments.  Not sure how it
compares to Mime::Lite.

-doug

On Thu, 13 Jun 2002, Jon Robison wrote:

 Can anyone give me recommendations on a good Mail handler that
 integrates well with mod_perl?
 
 I have a system whereby I want to give people the ability to mail the
 currently viewed page to someone. Once they select a To: address, the
 system will look up some data, re-construct the viewed page in a textual
 format, and send the mail.
 
 I'm just looking for recommendations on a good perl mailing module for
 this kind of use.
 
 --Jon Robison
 

-- 
~~
Doug Silver
619 235-2665
Network Manager
Urchin Software Corp.   http://www.urchin.com
~~




Re: Sending Mail

2002-06-13 Thread Jon Robison

Geesh, it's nice having the books author(s) on the mailing list here!

--Jon R.

Geoffrey Young wrote:
 
 Jon Robison wrote:
 
  Can MIME::Lite do attachments?
 
 
 yes.  there is an example in the cookbook that uses MIME::Lite:
 
 http://www.modperlcookbook.org/code/ch15/Cookbook/Mail.pm
 http://www.modperlcookbook.org/code/ch15/Cookbook/EmailUploads.pm
 
 HTH
 
 --Geoff



Re: Trouble sending mail under modperl...

1999-10-27 Thread Gunther Birznieks

The advantage of using sendmail is 

[1] a centralised MTA config.
[2] Graceful handling of problems and requeueing of messages if the SMTP
server specified by Net::SMTP would normally be down. eg automatic
resilience based on MX record rerouting can be nice.

Although in a mod_perl situation, I understand the launching of a system
call is not the best thing to do. However, it could be if sendmail itself
is launched to asynchronously handle the posting of the mail while the
cript continues on (if the mail server were otherwise slow for some
reason).

I guess what you use depends on what your circumstances are.

Later,
  Gunther

On Tue, 26 Oct 1999, Stas Bekman wrote:

  Hello, mod_perloids.
  
  I'm having a gutfull of trouble sending mail under mod_perl. I'm doing
  it by the books, to wit, the cookbook and the bigbirdie book, under rh
  linux 5.2.
  
  the code is
  
   warn ("MAIL: Opening sendmail... path is \"".$sendmailpath."\"");
   open (SENDMAIL, $sendmailpath) || warn ("MAIL: Cannot open sendmail
  at \"".$sendmailpath."\"");
   print SENDMAIL ( "From: Eidos Web Password Assistant
  passwordhelp\@".$dbh-{r}-server-server_hostname."\n".
  "To: You ".$dbh-{param}-{csemail}."\n".
  "Subject:
  ".$EidosParser::locale{mailsendpasswordsubject}."\n\n".
  $EidosParser::locale{mailsendpasswordtext1}.
  $result[1].
  $EidosParser::locale{mailsendpasswordtext2}.
  ($dbh-{r}-server-server_hostname).($dbh-{r}-uri()).
  $EidosParser::locale{mailsendpasswordtext3}.
  "\n.\n");
   warn ("MAIL: Mail Sent okay!");
   close (SENDMAIL);
  
  I ditched the fail-result tests in desperation. :)
  
  It tells me the mail has been sent okay (even when the failiure tests
  were in place) but nothing. Not in the outgoing or incoming mail spools.
  I tested this code as a vanilla cgi script, and it worked fine. I have
  *no* idea why it won't work under mod_perl.
  
  Anyone else had similar problems (or solutions :), 
  or should I Just Shut Up?
 
 Hmmm, a funny way to ask questions... let me try too: Should we answer the
 question or Just Shut Up? :) 
 
 Anyway, how do you know it's a mod_perl problem? How do you know it has
 something to do with mail? Oh, yeah the mail has never reached the
 destination... Did you try to print out what you send instead of piping it
 to sendmail? Check that the generated headers are correct ones...
 
 Other than that, why not to use Net::SMTP, which verifies each command and
 you can arrange your code to die or warn on failure to send some field,
 since it talks directly to the smtp server... take a look at the simple
 send_mail() implemented that way (BTW, it's much faster and lighter than
 sendmail, but this is off-topic...)
 http://www.singlesheaven.com/stas/TULARC/works/scripts/mail-lib.pl
 
 Hope this helps...
 
 ___
 Stas Bekman  mailto:[EMAIL PROTECTED]www.singlesheaven.com/stas  
 Perl,CGI,Apache,Linux,Web,Java,PC at  www.singlesheaven.com/stas/TULARC
 www.apache.org   www.perl.com  == www.modperl.com  ||  perl.apache.org
 single o- + single o-+ = singlesheavenhttp://www.singlesheaven.com
 



Re: Trouble sending mail under modperl...

1999-10-27 Thread Robin Berjon

At 14:02 27/10/1999 -0400, Gunther Birznieks wrote:
The advantage of using sendmail is 

[1] a centralised MTA config.
[2] Graceful handling of problems and requeueing of messages if the SMTP
server specified by Net::SMTP would normally be down. eg automatic
resilience based on MX record rerouting can be nice.

Although in a mod_perl situation, I understand the launching of a system
call is not the best thing to do. However, it could be if sendmail itself
is launched to asynchronously handle the posting of the mail while the
cript continues on (if the mail server were otherwise slow for some
reason).

To pretend this roughly on-topic, we'll say that the problem is actually to
avoid spawning an external process everytime you want to send mail (which
is imho the only problem with using sendmail). So far I have solved this by
writing all emails to a file which gets rotated by a cron job. It's worked
fine for me.


.Robin
Critic, n.: A person who boasts himself hard to please because nobody tries
to please him.



Re: Trouble sending mail under modperl...

1999-10-27 Thread Matt Sergeant

On Wed, 27 Oct 1999, Robin Berjon wrote:
 At 14:02 27/10/1999 -0400, Gunther Birznieks wrote:
 The advantage of using sendmail is 
 
 [1] a centralised MTA config.
 [2] Graceful handling of problems and requeueing of messages if the SMTP
 server specified by Net::SMTP would normally be down. eg automatic
 resilience based on MX record rerouting can be nice.
 
 Although in a mod_perl situation, I understand the launching of a system
 call is not the best thing to do. However, it could be if sendmail itself
 is launched to asynchronously handle the posting of the mail while the
 cript continues on (if the mail server were otherwise slow for some
 reason).
 
 To pretend this roughly on-topic, we'll say that the problem is actually to
 avoid spawning an external process everytime you want to send mail (which
 is imho the only problem with using sendmail). So far I have solved this by
 writing all emails to a file which gets rotated by a cron job. It's worked
 fine for me.

I have achieved this by dumping sendmail. Seems like a far cleaner solution
to me. Personally I use qmail, although I hear postfix and post.office are
all good solutions. (although I don't know about the other's wrt spawning
processes)

--
Matt/

Details: FastNet Software Ltd - XML, Perl, Databases.
Tagline: High Performance Web Solutions
Web Sites: http://come.to/fastnet http://sergeant.org
Available for Consultancy, Contracts and Training.



Trouble sending mail under modperl...

1999-10-26 Thread Dave Mee

Hello, mod_perloids.

I'm having a gutfull of trouble sending mail under mod_perl. I'm doing
it by the books, to wit, the cookbook and the bigbirdie book, under rh
linux 5.2.

the code is

 warn ("MAIL: Opening sendmail... path is \"".$sendmailpath."\"");
 open (SENDMAIL, $sendmailpath) || warn ("MAIL: Cannot open sendmail
at \"".$sendmailpath."\"");
 print SENDMAIL ( "From: Eidos Web Password Assistant
passwordhelp\@".$dbh-{r}-server-server_hostname."\n".
"To: You ".$dbh-{param}-{csemail}."\n".
"Subject:
".$EidosParser::locale{mailsendpasswordsubject}."\n\n".
$EidosParser::locale{mailsendpasswordtext1}.
$result[1].
$EidosParser::locale{mailsendpasswordtext2}.
($dbh-{r}-server-server_hostname).($dbh-{r}-uri()).
$EidosParser::locale{mailsendpasswordtext3}.
"\n.\n");
 warn ("MAIL: Mail Sent okay!");
 close (SENDMAIL);

I ditched the fail-result tests in desperation. :)

It tells me the mail has been sent okay (even when the failiure tests
were in place) but nothing. Not in the outgoing or incoming mail spools.
I tested this code as a vanilla cgi script, and it worked fine. I have
*no* idea why it won't work under mod_perl.

Anyone else had similar problems (or solutions :), or should I Just Shut
Up?

Dave




Re: Trouble sending mail under modperl...

1999-10-26 Thread Stas Bekman

 Hello, mod_perloids.
 
 I'm having a gutfull of trouble sending mail under mod_perl. I'm doing
 it by the books, to wit, the cookbook and the bigbirdie book, under rh
 linux 5.2.
 
 the code is
 
  warn ("MAIL: Opening sendmail... path is \"".$sendmailpath."\"");
  open (SENDMAIL, $sendmailpath) || warn ("MAIL: Cannot open sendmail
 at \"".$sendmailpath."\"");
  print SENDMAIL ( "From: Eidos Web Password Assistant
 passwordhelp\@".$dbh-{r}-server-server_hostname."\n".
 "To: You ".$dbh-{param}-{csemail}."\n".
 "Subject:
 ".$EidosParser::locale{mailsendpasswordsubject}."\n\n".
 $EidosParser::locale{mailsendpasswordtext1}.
 $result[1].
 $EidosParser::locale{mailsendpasswordtext2}.
 ($dbh-{r}-server-server_hostname).($dbh-{r}-uri()).
 $EidosParser::locale{mailsendpasswordtext3}.
 "\n.\n");
  warn ("MAIL: Mail Sent okay!");
  close (SENDMAIL);
 
 I ditched the fail-result tests in desperation. :)
 
 It tells me the mail has been sent okay (even when the failiure tests
 were in place) but nothing. Not in the outgoing or incoming mail spools.
 I tested this code as a vanilla cgi script, and it worked fine. I have
 *no* idea why it won't work under mod_perl.
 
 Anyone else had similar problems (or solutions :), 
 or should I Just Shut Up?

Hmmm, a funny way to ask questions... let me try too: Should we answer the
question or Just Shut Up? :) 

Anyway, how do you know it's a mod_perl problem? How do you know it has
something to do with mail? Oh, yeah the mail has never reached the
destination... Did you try to print out what you send instead of piping it
to sendmail? Check that the generated headers are correct ones...

Other than that, why not to use Net::SMTP, which verifies each command and
you can arrange your code to die or warn on failure to send some field,
since it talks directly to the smtp server... take a look at the simple
send_mail() implemented that way (BTW, it's much faster and lighter than
sendmail, but this is off-topic...)
http://www.singlesheaven.com/stas/TULARC/works/scripts/mail-lib.pl

Hope this helps...

___
Stas Bekman  mailto:[EMAIL PROTECTED]www.singlesheaven.com/stas  
Perl,CGI,Apache,Linux,Web,Java,PC at  www.singlesheaven.com/stas/TULARC
www.apache.org   www.perl.com  == www.modperl.com  ||  perl.apache.org
single o- + single o-+ = singlesheavenhttp://www.singlesheaven.com



Re: Trouble sending mail under modperl...

1999-10-26 Thread Frank D. Cringle

Dave Mee [EMAIL PROTECTED] writes:
 Hello, mod_perloids.
 
 I'm having a gutfull of trouble sending mail under mod_perl. I'm doing
 it by the books, to wit, the cookbook and the bigbirdie book, under rh
 linux 5.2.
 
 the code is
 
  warn ("MAIL: Opening sendmail... path is \"".$sendmailpath."\"");
  open (SENDMAIL, $sendmailpath) || warn ("MAIL: Cannot open sendmail
 at \"".$sendmailpath."\"");

Let's assume that $sendmailpath is a pipe ("|/usr/lib/sendmail ...")

  print SENDMAIL ( "From: Eidos Web Password Assistant
 passwordhelp\@".$dbh-{r}-server-server_hostname."\n".
 "To: You ".$dbh-{param}-{csemail}."\n".
 "Subject:
 ".$EidosParser::locale{mailsendpasswordsubject}."\n\n".
 $EidosParser::locale{mailsendpasswordtext1}.
 $result[1].
 $EidosParser::locale{mailsendpasswordtext2}.
 ($dbh-{r}-server-server_hostname).($dbh-{r}-uri()).
 $EidosParser::locale{mailsendpasswordtext3}.
 "\n.\n");
  warn ("MAIL: Mail Sent okay!");
  close (SENDMAIL);
 
 I ditched the fail-result tests in desperation. :)
 
 It tells me the mail has been sent okay (even when the failiure tests
 were in place) but nothing.

The essential failure-test is missing.  Only during close() do you find
out if there was a problem writing to the pipe when the last (possibly 
only) bufferful of data gets flushed to it.

 Not in the outgoing or incoming mail spools.
 I tested this code as a vanilla cgi script, and it worked fine. I have
 *no* idea why it won't work under mod_perl.

There shouldn't be much difference.  Maybe some obscure environment
variable, or your cgi is suexec'ed to a different user?

-- 
Frank Cringle,  [EMAIL PROTECTED]
voice: (+49 2304) 467101; fax: 943357



Re: Trouble sending mail under modperl...

1999-10-26 Thread Ask Bjoern Hansen

On Tue, 26 Oct 1999, Stas Bekman wrote:

[...]
 Other than that, why not to use Net::SMTP, which verifies each command and
 you can arrange your code to die or warn on failure to send some field,
 since it talks directly to the smtp server... take a look at the simple
 send_mail() implemented that way (BTW, it's much faster and lighter than
 sendmail, but this is off-topic...)

Eh, if the mail server is still sendmail it doesn't make much of a
difference how you connect to it.

I prefer Net::SMTP too though.

And you're right, it's not really on-topic.


 - ask

-- 
ask bjoern hansen - http://www.netcetera.dk/~ask/
more than 50M impressions per day, http://valueclick.com