You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by RobertCZ <ro...@robert.cz> on 2005/04/07 09:04:31 UTC

Embperl::Mail bug

Hi,

  when calling Embperl::Mail twice from the same page, second time it 
may send the body of the first email. Following code sends two emails 
with different subjects, but with identical body 'test1 test1'

- R.


use Embperl::Mail;

$mail = qq{ test1 test1 };
Embperl::Mail::Execute({
    input         => \$mail,
    subject     => 'Embperl email test1',
    to         => 'xxx@xxx.cz',
    from         => 'robert@robert.cz',
});

$mail = qq{ test2 test2 };
Embperl::Mail::Execute({
    input         => \$mail,
    subject     => 'Embperl email test2',
    to         => 'xxx@xxx.cz',
    from         => 'robert@robert.cz',
});


the problem persists even if input is two completely different vars


use Embperl::Mail;

$mail1 = qq{ test1 test1 };
Embperl::Mail::Execute({
    input         => \$mail1,
    subject     => 'Embperl email test1',
    to         => 'xxx@xxx.cz',
    from         => 'robert@robert.cz',
});

$mail = qq{ test2 test2 };
Embperl::Mail::Execute({
    input         => \$mail,
    subject     => 'Embperl email test2',
    to         => 'xxx@xxx.cz',
    from         => 'robert@robert.cz',
});


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


Re: Embperl::Mail bug

Posted by RobertCZ <ro...@robert.cz>.
RobertCZ wrote:

ups, second example should be

> $mail2 = qq{ test2 test2 };
> Embperl::Mail::Execute({
>    input         => \$mail2,
>    subject     => 'Embperl email test2',
>    to         => 'xxx@xxx.cz',
>    from         => 'robert@robert.cz',
> });


but whatever I do, even if I execute two different input files, the 
second email is always wrong

at least an idea how to work around it? thanks

- r.


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


Re: Embperl::Mail bug

Posted by RobertCZ <ro...@robert.cz>.
Gerald Richter wrote:

>>OK, now I run it with inputfile => email1.eo / inputfile => 
>>email2.eo and it works, thanks a lot. However, both email?.eo 
>>are identical, I just call them with a modified udat, so it's 
>>not optimal, I need to mainten it twice. Is there a way to 
>>use inputfile/other param to tell Embperl not to use the 
>>cached version? Embperl::Mail::Execute is called with 
>>difeferent 'to', but this doesn't seem to be big enough difference.
>>    
>>
>
>Yes, you can use the mtime parameter. Changing it causes Embperl to
>recompile, setting it to undef, causeing Embperl to always compile.
>  
>
Setting mtime to undef fixed it, but it didn't work in the beggining - 
this an additional problem I cannot reproduce anymore, maybe the problem 
was that the source file wasn't modified or apache restarted  something 
like that.

>>PS. Somewhere in Readme2, you say optKeepSpaces does work 
>>only from httpd.conf - is there now any way to set it in 
>>Execute? It would be really usefull especially in Embperl::Mail...
>>    
>>
>
>You could also pass it to Execute, you just cannot change it inside the
>page, because at this point parsing (and removing spaces) is already done.
>Anyway optKeepSpaces is on for Embperl::Mail by default
>  
>

Yes, now it works... I called Execute filename=>... outut => $string 
first, then Embperl::Mail::Execute input => $string so I lost spaces... ;-)

Thanks for your help.

- Robert


RE: Embperl::Mail bug

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

> 
> OK, now I run it with inputfile => email1.eo / inputfile => 
> email2.eo and it works, thanks a lot. However, both email?.eo 
> are identical, I just call them with a modified udat, so it's 
> not optimal, I need to mainten it twice. Is there a way to 
> use inputfile/other param to tell Embperl not to use the 
> cached version? Embperl::Mail::Execute is called with 
> difeferent 'to', but this doesn't seem to be big enough difference.
> 

Yes, you can use the mtime parameter. Changing it causes Embperl to
recompile, setting it to undef, causeing Embperl to always compile.


> - R.
> 
> PS. Somewhere in Readme2, you say optKeepSpaces does work 
> only from httpd.conf - is there now any way to set it in 
> Execute? It would be really usefull especially in Embperl::Mail...
> 

You could also pass it to Execute, you just cannot change it inside the
page, because at this point parsing (and removing spaces) is already done.
Anyway optKeepSpaces is on for Embperl::Mail by default

Gerald



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


Re: Embperl::Mail bug

Posted by RobertCZ <ro...@robert.cz>.
Gerald Richter wrote:

>>  when calling Embperl::Mail twice from the same page, second 
>>time it may send the body of the first email. Following code 
>>sends two emails with different subjects, but with identical 
>>body 'test1 test1'
>>    
>>
>
>The problem should go away when you specify different strings as inputfile
>=> parameter (This tells Embperl that your source is different, otherwise it
>uses the cached one)
>  
>

OK, now I run it with inputfile => email1.eo / inputfile => email2.eo 
and it works, thanks a lot. However, both email?.eo are identical, I 
just call them with a modified udat, so it's not optimal, I need to 
mainten it twice. Is there a way to use inputfile/other param to tell 
Embperl not to use the cached version? Embperl::Mail::Execute is called 
with difeferent 'to', but this doesn't seem to be big enough difference.

- R.

PS. Somewhere in Readme2, you say optKeepSpaces does work only from 
httpd.conf - is there now any way to set it in Execute? It would be 
really usefull especially in Embperl::Mail...

RE: Embperl::Mail bug

Posted by Gerald Richter <ri...@ecos.de>.
Hi,
> 
>   when calling Embperl::Mail twice from the same page, second 
> time it may send the body of the first email. Following code 
> sends two emails with different subjects, but with identical 
> body 'test1 test1'
> 

The problem should go away when you specify different strings as inputfile
=> parameter (This tells Embperl that your source is different, otherwise it
uses the cached one)

Gerald


> - R.
> 
> 
> use Embperl::Mail;
> 
> $mail = qq{ test1 test1 };
> Embperl::Mail::Execute({
>     input         => \$mail,
>     subject     => 'Embperl email test1',
>     to         => 'xxx@xxx.cz',
>     from         => 'robert@robert.cz',
> });
> 
> $mail = qq{ test2 test2 };
> Embperl::Mail::Execute({
>     input         => \$mail,
>     subject     => 'Embperl email test2',
>     to         => 'xxx@xxx.cz',
>     from         => 'robert@robert.cz',
> });
> 
> 
> the problem persists even if input is two completely different vars
> 
> 
> use Embperl::Mail;
> 
> $mail1 = qq{ test1 test1 };
> Embperl::Mail::Execute({
>     input         => \$mail1,
>     subject     => 'Embperl email test1',
>     to         => 'xxx@xxx.cz',
>     from         => 'robert@robert.cz',
> });
> 
> $mail = qq{ test2 test2 };
> Embperl::Mail::Execute({
>     input         => \$mail,
>     subject     => 'Embperl email test2',
>     to         => 'xxx@xxx.cz',
>     from         => 'robert@robert.cz',
> });
> 
> 
> ---------------------------------------------------------------------
> 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