Fix error management

This commit is contained in:
Laurent Destailleur 2019-11-21 18:51:26 +01:00
parent 11be3b53f3
commit 6ef01a09f3

View File

@ -418,11 +418,18 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if (function_exists('imap_open')) if (function_exists('imap_open'))
{ {
$connectstringserver = $object->getConnectStringIMAP(); $connectstringserver = $object->getConnectStringIMAP();
try {
$connectstringsource = $connectstringserver.imap_utf7_encode($sourcedir); $connectstringsource = $connectstringserver.imap_utf7_encode($sourcedir);
$connectstringtarget = $connectstringserver.imap_utf7_encode($targetdir); $connectstringtarget = $connectstringserver.imap_utf7_encode($targetdir);
$connection = imap_open($connectstringsource, $object->login, $object->password); $connection = imap_open($connectstringsource, $object->login, $object->password);
} }
catch(Exception $e)
{
print $e->getMessage();
}
}
else else
{ {
$morehtml .= 'IMAP functions not available on your PHP'; $morehtml .= 'IMAP functions not available on your PHP';