Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- newbie: mail() returns false
March 8, 2008, 8:22 pm
rate this thread
I am trying to send an e-mail message using mail() function. (I use PHP5 in
Windows XP). The problem is that I receive return value false.
$subscribers = @file('Paper/Subscribers.txt');
$sent = true;
foreach ($subscribers as $subscriber)
$subject = ...;
$message = ...;
$headers = "MIME-Version: 1.0\r\nContent-type: text/html;
if (mail($subscriber, $subject, $message, $headers) === false)
$sent = false;
After this code $sent === false. The file Paper/Subscribers.txt contains 1
e-mail address (1 line).
I don't know what is wrong (I have little experience). Could you help me
Re: newbie: mail() returns false
You have to configure php to use smtp. Because usually windows runs no
service to send mails like *nix does.
Used under Windows only: host name or IP address of the SMTP
server PHP should use for mail sent with the mail() function."
http://portal.richler.de/ Namensportal zu Richler
http://www.richler.de/ Heiko Richler: Computer - Know How!
http://www.richler.info/ private Homepage