You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by PILCH Hartmut <ph...@a2e.de> on 2006/02/20 17:09:05 UTC

only static messages via Embperl::Mail ?

When invoking Embperl::Mail I have to specify an inputfile, e.g.

  Embperl::Mail::Execute({inputfile=>'msg.htm', subject=>'error $msgnr: $msgtxt', from=>'web@a2e.de', reply-to=>'oas@a2e.de', to=>'phm@a2e.de'}, );

Unfortunately msg.htm is a completely separate namespace which does not appear
to share any variables with the invoking file.

So my attempt to use Embperl::Mail for reporting something that just happened
failed.  All I can send is the same old prefabricated messages.

Do I have to resort to generating a message file from within Embperl and
then sending that?

That would be a rather awkward workaround.  In the docs I looked for ways to
send a text directly but didn't find it.

--
Hartmut Pilch					0049-89-12789608    
FFII					      http://a2e.de/ffii



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


Re: only static messages via Embperl::Mail ?

Posted by RobertCZ <ro...@robert.cz>.
no, input => \$mail is ok as long as you also specify inputfile => 
'somename' (as is said clearly in the docs) otherwise embperl can't 
cache it correctly


PILCH Hartmut wrote:
>  > just use something like
>  > 
>  > $mail = "error message";
>  > Embperl::Mail::Execute({ input => \$mail, mtime => undef, inputfile => 
>  > 'error', to => ... });
>
> Indeed this works, even without the inputfile=>'error' and mtime=>undef
> parameters it seems.
>
> I read on the archive at
>
>
> 	http://www.ecos.de/~mailarc/embperl/2005-04/msg00006.html
>
>
> that the "input=>\$mail" method didn't always work in the past and that
> apparently Gerald advises against using it.  Also I can't find it in the
> docs.  So I'm a bit concerned it might be somehow deprecated or not
> officially supported.  Of course I prefer to specify an input string rather
> than an input file in most cases.
>
> --
> Hartmut Pilch
> http://a2e.de/phm
>
>
>
>
>
> ---------------------------------------------------------------------
> 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: only static messages via Embperl::Mail ?

Posted by PILCH Hartmut <ph...@a2e.de>.
 > just use something like
 > 
 > $mail = "error message";
 > Embperl::Mail::Execute({ input => \$mail, mtime => undef, inputfile => 
 > 'error', to => ... });

Indeed this works, even without the inputfile=>'error' and mtime=>undef
parameters it seems.

I read on the archive at


	http://www.ecos.de/~mailarc/embperl/2005-04/msg00006.html


that the "input=>\$mail" method didn't always work in the past and that
apparently Gerald advises against using it.  Also I can't find it in the
docs.  So I'm a bit concerned it might be somehow deprecated or not
officially supported.  Of course I prefer to specify an input string rather
than an input file in most cases.

--
Hartmut Pilch
http://a2e.de/phm





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


Re: only static messages via Embperl::Mail ?

Posted by Robert Germic <ge...@pcv.cz>.
PILCH Hartmut wrote:
> When invoking Embperl::Mail I have to specify an inputfile, e.g.
>
>   Embperl::Mail::Execute({inputfile=>'msg.htm', subject=>'error $msgnr: $msgtxt', from=>'web@a2e.de', reply-to=>'oas@a2e.de', to=>'phm@a2e.de'}, );
>
> Unfortunately msg.htm is a completely separate namespace which does not appear
> to share any variables with the invoking file.
>
>   

just use something like

$mail = "error message";
Embperl::Mail::Execute({ input => \$mail, mtime => undef, inputfile => 
'error', to => ... });

or use param to pass parameters to your msg.html

- Robert

> So my attempt to use Embperl::Mail for reporting something that just happened
> failed.  All I can send is the same old prefabricated messages.
>
> Do I have to resort to generating a message file from within Embperl and
> then sending that?
>
> That would be a rather awkward workaround.  In the docs I looked for ways to
> send a text directly but didn't find it.
>
> --
> Hartmut Pilch					0049-89-12789608    
> FFII					      http://a2e.de/ffii
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
>
>   


-- 
             S pozdravem/Best Regards

                                   Robert Germic


Prvni ceska virtualni s.r.o., Vinohradska 25/35,  CZ-120 00 Praha 2
Email: germic@pcv.cz, Mob. tel.: (+420 602) 213 480

NetBooking Czech Republic s.r.o., Trebohostická 12, CZ-100 00 Praha 10
Email: germic@netbooking.cz, Mob. tel.: (+420 602) 512 512


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


RE: only static messages via Embperl::Mail ?

Posted by Gerald Richter <ri...@ecos.de>.
> 
> When invoking Embperl::Mail I have to specify an inputfile, e.g.
> 
>   Embperl::Mail::Execute({inputfile=>'msg.htm', 
> subject=>'error $msgnr: $msgtxt', from=>'web@a2e.de', 
> reply-to=>'oas@a2e.de', to=>'phm@a2e.de'}, );
> 
> Unfortunately msg.htm is a completely separate namespace 
> which does not appear to share any variables with the invoking file.
> 

When you call it from another Embperl page, you get the same global Embperl
variables, like %fdat, the Embperl request and application object ($epreq
and $epapp). You can also pass parameters like:

   Embperl::Mail::Execute({inputfile=>'msg.htm', 
 subject=>'error $msgnr: $msgtxt', from=>'web@a2e.de', 
 reply-to=>'oas@a2e.de', to=>'phm@a2e.de'}, 

 param => [1,2,3],

);

These will appear in the msg.htm in @param

Gerald



 
** Virus checked by BB-5000 Mailfilter ** 


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