Here, is my php script :
my php.ini:
if I execute the script using a browser, it works fine :
but if I execute the script using a bat file, it doesn't work.
It seems like php is not reading the php.ini.
Run the command php --ini
and see if the Loaded Configuration File: is the correct one.
You can tell php where to find the right php.ini by adding the option -c:
php -c C:\php\php.ini -f C:\wamp\...\mail.php