newbie: mail() returns false

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

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

R.A.M. wrote:
Quoted text here. Click to load it
Quoted text here. Click to load it

You have to configure php to use smtp. Because usually windows runs no
service to send mails like *nix does.

"SMTP  string
    Used under Windows only: host name or IP address of the SMTP
    server PHP should use for mail sent with the mail() function."


-- Namensportal zu Richler Heiko Richler: Computer - Know How! private Homepage

Site Timeline