toufik toufik wrote:
I'm having the folowing error :
Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header
missing in c:\....filename
when I try to send a simple email using the folowing code:
mail(to******@hotmail.com, "Mon Sujet", "Ligne 1\nLigne 2\nLigne 3");
I'm running Appache/php/mySql,
You have to set up php.ini correctly.
According to the headers I think you're using Windows so the lines
to change in php.ini are "SMTP" and "sendmail_from".
This script will tell you the current values of your configuration:
<?php
echo '<p>SMTP: ', ini_get('SMTP'), '</p>';
echo '<p>sendmail_from: ', ini_get('sendmail_from'), '</p>';
?>
If you just want one script to send mails you may want to try
reconfiguring just for that one
<?php
ini_set('SMTP', '<THE.MAIL.SERVER.YOU.USE>'); // eg: mx.example.com
ini_set('sendmail_from', 'Y***********@THE.MAIL.SERVER'); // eg:
me@example.com
// ...
// rest of the script
?>
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--