You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by John Scanlon <sc...@rci.rutgers.edu> on 2001/06/29 17:44:07 UTC

Using Mail modules with Embperl

We've tried to use both the Mail::Sendmail and Mail::Sender modules with 
Embperl, and have come across the same difficulty with both: a script will 
work correctly once (i.e. will send mail out through an SMTP server) and 
then will not work again until Apache is re-booted.  Can anyone shed some 
light, or offer suggestions?  We're using Embperl 1.3b3, Apache 1.3.12 and 
Mod_Perl 1.23.

Thanks,

John Scanlon
Rutgers University 

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Using Mail modules with Embperl

Posted by Akshay Arora <ak...@5vs1.com>.
I've had quite a bit of success with the MIME::Lite module. It isn't
installed with Perl, but CPAN has no problem installing it.

It has a similar syntax to Mail::Sender. I haven't tried sending
attachments with it, but it seems like that MIME::Lite might be able to
do that as well.

-Akshay

Neil Gunton wrote:
> 
> John Scanlon wrote:
> >
> > We've tried to use both the Mail::Sendmail and Mail::Sender modules with
> > Embperl, and have come across the same difficulty with both: a script will
> > work correctly once (i.e. will send mail out through an SMTP server) and
> > then will not work again until Apache is re-booted.  Can anyone shed some
> > light, or offer suggestions?  We're using Embperl 1.3b3, Apache 1.3.12 and
> > Mod_Perl 1.23.
> 
> I use Mail::Sender in my community website without any problems. The
> code looks something like this:
> 
> use Mail::Sender;
> $sender = new Mail::Sender ({smtp => "mail.nilspace.com"});
> $sender->MailMsg ({from => 'guestbook@crazyguyonabike.com',
>                    replyto => "$message->{name} <$message->{email}>",
>                    to => $author->{email},
>                    subject => "Guestbook: $author->{tourname}",
>                    msg => "$text\n\n$extra"
>                    });
> undef $sender;
> 
> Whenever someone posts a message in a journal guestbook, the message is
> also sent by email to the author of the journal. This is what's
> happening here.
> 
> I don't have any special httpd.conf settings to cater to Mail::Sender,
> so let me know if this code is any different from the way you do it...
> perhaps the 'undef $sender' makes a difference for subsequent calls.
> 
> HTH
> 
> -Neil
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org

--
http://www.5vs1.com - A Pearl Jam Fan Site

"Only when the last tree is dead, the last river damned, and the last
field paved, will we realize that we can't eat money."

"Time is long and life is short, so begin to live while you still can."
			-Eddie Vedder

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Using Mail modules with Embperl

Posted by Neil Gunton <ne...@nilspace.com>.
John Scanlon wrote:
> 
> We've tried to use both the Mail::Sendmail and Mail::Sender modules with
> Embperl, and have come across the same difficulty with both: a script will
> work correctly once (i.e. will send mail out through an SMTP server) and
> then will not work again until Apache is re-booted.  Can anyone shed some
> light, or offer suggestions?  We're using Embperl 1.3b3, Apache 1.3.12 and
> Mod_Perl 1.23.

I use Mail::Sender in my community website without any problems. The
code looks something like this:

use Mail::Sender;
$sender = new Mail::Sender ({smtp => "mail.nilspace.com"});
$sender->MailMsg ({from => 'guestbook@crazyguyonabike.com',
		   replyto => "$message->{name} <$message->{email}>",
		   to => $author->{email},
		   subject => "Guestbook: $author->{tourname}",
		   msg => "$text\n\n$extra"
		   });
undef $sender;

Whenever someone posts a message in a journal guestbook, the message is
also sent by email to the author of the journal. This is what's
happening here.

I don't have any special httpd.conf settings to cater to Mail::Sender,
so let me know if this code is any different from the way you do it...
perhaps the 'undef $sender' makes a difference for subsequent calls.

HTH

-Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Using Mail modules with Embperl

Posted by Gerald Richter <ri...@ecos.de>.

> Yes, we are running on Windows.

The only solution, due to the socket problem under mod_perl and windows, I
have found, is to start an extra process that acutally send the mail. For
example via system:

system ("perl mail.pl") ;

(of course you need a way how to pass the mail data you want to send, either
via the command line or via stdin)

> Thanks for the information, and I'll take
> a look at HTML::Embperl::Mail
>

That has the same problem with sockets under windows (i.e. it works only
once), but you can use it in such a programm like I suggest above

Gerald


> John
>
> On Sat, 30 Jun 2001, Gerald Richter wrote:
>
> > > We've tried to use both the Mail::Sendmail and Mail::Sender modules
with
> > > Embperl, and have come across the same difficulty with both: a script
will
> > > work correctly once (i.e. will send mail out through an SMTP server)
and
> > > then will not work again until Apache is re-booted.  Can anyone shed
some
> > > light, or offer suggestions?  We're using Embperl 1.3b3, Apache 1.3.12
and
> > > Mod_Perl 1.23.
> > >
> >
> > Are you running on Windows ? On windows I know about problem with
sockets,
> > which only works once under mod_perl/Apache, which would explain your
> > problem. On Unix I use successfully Net::SMTP to send mail. Maybe you
try
> > HTML::Embperl::Mail (which is part of Embperl distribution), does this
work
> > for you ?
> >
> > Gerald
> >
> > P.S. I am out of office for the next week, so I am not able to answer
before
> > july, 8.
> >
> > -------------------------------------------------------------
> > Gerald Richter    ecos electronic communication services gmbh
> > Internetconnect * Webserver/-design/-datenbanken * Consulting
> >
> > Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
> > E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
> > WWW:        http://www.ecos.de      Fax:      +49 6133 925152
> > -------------------------------------------------------------
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> > For additional commands, e-mail: embperl-help@perl.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
>
>
>


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Using Mail modules with Embperl

Posted by John Scanlon <sc...@rci.rutgers.edu>.
Yes, we are running on Windows.  Thanks for the information, and I'll take
a look at HTML::Embperl::Mail

John

On Sat, 30 Jun 2001, Gerald Richter wrote:

> > We've tried to use both the Mail::Sendmail and Mail::Sender modules with
> > Embperl, and have come across the same difficulty with both: a script will
> > work correctly once (i.e. will send mail out through an SMTP server) and
> > then will not work again until Apache is re-booted.  Can anyone shed some
> > light, or offer suggestions?  We're using Embperl 1.3b3, Apache 1.3.12 and
> > Mod_Perl 1.23.
> >
> 
> Are you running on Windows ? On windows I know about problem with sockets,
> which only works once under mod_perl/Apache, which would explain your
> problem. On Unix I use successfully Net::SMTP to send mail. Maybe you try
> HTML::Embperl::Mail (which is part of Embperl distribution), does this work
> for you ?
> 
> Gerald
> 
> P.S. I am out of office for the next week, so I am not able to answer before
> july, 8.
> 
> -------------------------------------------------------------
> Gerald Richter    ecos electronic communication services gmbh
> Internetconnect * Webserver/-design/-datenbanken * Consulting
> 
> Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
> E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
> WWW:        http://www.ecos.de      Fax:      +49 6133 925152
> -------------------------------------------------------------
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Using Mail modules with Embperl

Posted by Gerald Richter <ri...@ecos.de>.
> We've tried to use both the Mail::Sendmail and Mail::Sender modules with
> Embperl, and have come across the same difficulty with both: a script will
> work correctly once (i.e. will send mail out through an SMTP server) and
> then will not work again until Apache is re-booted.  Can anyone shed some
> light, or offer suggestions?  We're using Embperl 1.3b3, Apache 1.3.12 and
> Mod_Perl 1.23.
>

Are you running on Windows ? On windows I know about problem with sockets,
which only works once under mod_perl/Apache, which would explain your
problem. On Unix I use successfully Net::SMTP to send mail. Maybe you try
HTML::Embperl::Mail (which is part of Embperl distribution), does this work
for you ?

Gerald

P.S. I am out of office for the next week, so I am not able to answer before
july, 8.

-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org