I'm working on a php script which has to send emails. But my mail() function doesn't work. I know that I have to configure somehow php.ini and may be something else but I don't know what exactly and how. I installed sendmail, by the way. Any ideas? Thanks a lot. this is my code.
error_reporting(E_ALL);
$to = 'name@gmail.com';
$subject = 'subject';
$message = 'text';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=windows-1251' . "\r\n";
$headers .= 'To: user <user@example.com>' . "\r\n";
$headers .= 'From: server <server@example.com>' . "\r\n";
mail($to, $subject, $message, $headers);
in php.ini i put sendmail_path ="/usr/sbin/sendmail"
ps. i Use Ubuntu
guys, in the mail.log file i got
Apr 29 16:12:05 IT02 sendmail[7660]: My unqualified host name (IT02) unknown; sleeping for retry
Apr 29 16:13:05 IT02 sendmail[7660]: unable to qualify my own domain name (IT02) -- using short name
Apr 29 16:13:05 IT02 sendmail[7660]: p3TED551007660: from=www-data, size=210, class=0, nrcpts=0, msgid=<201104291413.p3TED551007660@IT02>, bodytype=8BITMIME, relay=www-data@localhost
Does anybody know what it means?