toufik toufik wrote:
I'm having the folowing error :
Warning: mail(): "sendmail_f rom" 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******@h otmail.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_fr om: ', ini_get('sendma il_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.SERV ER.YOU.USE>'); // eg: mx.example.com
ini_set('sendma il_from', 'Y***********@T HE.MAIL.SERVER' ); // eg:
me@example.com
// ...
// rest of the script
?>
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--