Fix: ne sert que pour windows
This commit is contained in:
parent
71430a3d25
commit
d6b3e8675d
@ -177,10 +177,13 @@ class CMailFile
|
|||||||
$res=false;
|
$res=false;
|
||||||
|
|
||||||
if (! $conf->global->MAIN_DISABLE_ALL_MAILS)
|
if (! $conf->global->MAIN_DISABLE_ALL_MAILS)
|
||||||
|
{
|
||||||
|
if (isset($_SERVER["WINDIR"]))
|
||||||
{
|
{
|
||||||
if ($conf->global->MAIN_MAIL_SMTP_SERVER) ini_set('SMTP',$conf->global->MAIN_MAIL_SMTP_SERVER);
|
if ($conf->global->MAIN_MAIL_SMTP_SERVER) ini_set('SMTP',$conf->global->MAIN_MAIL_SMTP_SERVER);
|
||||||
if ($conf->global->MAIN_MAIL_SMTP_PORT) ini_set('smtp_port',$conf->global->MAIN_MAIL_SMTP_PORT);
|
if ($conf->global->MAIN_MAIL_SMTP_PORT) ini_set('smtp_port',$conf->global->MAIN_MAIL_SMTP_PORT);
|
||||||
if (!ini_get('sendmail_from') && $this->addr_from) ini_set('sendmail_from',getValidAddress($this->addr_from,2));
|
if ($this->addr_from) ini_set('sendmail_from',getValidAddress($this->addr_from,2));
|
||||||
|
}
|
||||||
|
|
||||||
$dest=getValidAddress($this->addr_to,2);
|
$dest=getValidAddress($this->addr_to,2);
|
||||||
if (! $dest)
|
if (! $dest)
|
||||||
@ -212,10 +215,13 @@ class CMailFile
|
|||||||
dolibarr_syslog("CMailFile::sendfile: mail end success");
|
dolibarr_syslog("CMailFile::sendfile: mail end success");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (isset($_SERVER["WINDIR"]))
|
||||||
|
{
|
||||||
if ($conf->global->MAIN_MAIL_SMTP_SERVER) ini_restore('SMTP');
|
if ($conf->global->MAIN_MAIL_SMTP_SERVER) ini_restore('SMTP');
|
||||||
if ($conf->global->MAIN_MAIL_SMTP_PORT) ini_restore('smtp_port');
|
if ($conf->global->MAIN_MAIL_SMTP_PORT) ini_restore('smtp_port');
|
||||||
ini_restore('sendmail_from');
|
ini_restore('sendmail_from');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error='No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS';
|
$this->error='No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user