Hi,
I'm very new to perl. I tried to use the perl module in php script, but im getting error
But Im getting this error
Fatal error: Uncaught exception 'PerlException' with message '[perl] call error: (in cleanup) Can't call method "Log" on an undefined value at /opt/otrs/Kernel/System/Email.pm line 178. ' in /var/www/mohan/t8.php:19 Stack trace: #0 /var/www/mohan/t8.php(19): Perl->Send(Array) #1 {main} thrown in /var/www/mohan/t8.php on line 19
And the module is working fine It has no problem. Please help me in solving out this issue........
I'm very new to perl. I tried to use the perl module in php script, but im getting error
Code:
<?php
$perl = new Perl();
$perl->eval("BEGIN {unshift( @INC, '/opt/otrs');}");
$perl->eval('use Kernel::System::Email qw(new Send ConfigObject LogObject DBObject TimeObject MainObject EncodeObject _MessageIDCreate Log Get); ');
$ar=array(From => 'me@example.com',
To => 'friend@example.com',
Subject => 'Some words!',
Charset => 'iso-8859-15',
MimeType => 'text/plain', # "text/plain" or "text/html"
Body => 'Some nice text',
InReplyTo => '<somemessageid-2@example.com>',
References => '<somemessageid-1@example.com> <somemessageid-2@example.com>',
Loop => 1, # not required, removes smtp from
Attachment => '',
Sign => '',
Crypt => '',
Priority => '',);
$ar1=array(Priority => 'error', Message => "Need $_!" );
var_dump($perl->Send($ar1));
var_dump($perl->eval('_MessageIDCreate->{ConfigObject}->Get();'));
?>
But Im getting this error
Fatal error: Uncaught exception 'PerlException' with message '[perl] call error: (in cleanup) Can't call method "Log" on an undefined value at /opt/otrs/Kernel/System/Email.pm line 178. ' in /var/www/mohan/t8.php:19 Stack trace: #0 /var/www/mohan/t8.php(19): Perl->Send(Array) #1 {main} thrown in /var/www/mohan/t8.php on line 19
And the module is working fine It has no problem. Please help me in solving out this issue........
Comment