I installed "mailutils" package in both servers, in the first server the mail is sent using command line, the second server the mail is not sent:
dpkg --get-selections for first server:
# dpkg --get-selections | grep mail
heirloom-mailx                                  install
libmail-sendmail-perl                           install
libmailtools-perl                               install
libmailutils2                                   install
libreoffice-emailmerge                          install
mailutils                                       install
procmail                                        install
sendmail-base                                   install
sendmail-bin                                    install
sendmail-cf                                     install
dpkg --get-selections for second server:
# dpkg --get-selections | grep mail
libmailutils2                                   install
libreoffice-emailmerge                          install
mailutils                                       install
The command line is:
echo -e "File mp4 is finished on Thank you for using this script" 2>&1 | sed '1!b;s/^/To: MYID@gmail.com\nSubject: File coding is done\n\n/' | sendmail -t
And this is the php function:
<?php
error_reporting(E_ALL);
$send = mail('MYID@gmail.com', 'sujet', 'salut');
if($send) {
echo 'mail sent';
}
else
{
echo 'oho';
}
?>
Thanks in advance
 
    