configure mail client to work with php.ini file?

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

Threaded View
hello everyone:

  I am trying to send email via php. I using window XP home edition.
My mail client is

outlook express. I configured mail client to send email via my aol
email account.

 mail server information: mail account:

server information: incoming mail: / port: 143
                               outgoing mail: / port: 587

  I changed php.ini file in order to match my email client setting
 //original setting
 ;SMTP = localhost
  ;smtp_port = 25

 //new setting
smtp_port = 587

 No matter which setting I use, I always got this error message

when I test my php file I got following error
"Warning: mail() [function.mail]: Failed to connect to mailserver at
"localhost" port 25, verify your "SMTP" and "smtp_port" setting in
php.ini or use ini_set() in C:\Program Files\Apache
Group\Apache2\htdocs\exer\chapter5\phpemail.php on line 28"

  I test my connection to localhost port25 by issuing following command
in dos prompt:
 telnet localhost 25

 I got error message:
Connecting To localhost...Could not open connection to the host, on
port 25: Connect failed

$to = "";

$subject = "Agenda for tomorrow's metting";

$message ="In tomorrow's meeting, we will discuss our new marketing
campaign and
           third-quarter sales results.";

$headers = "From: $from";

$messageSend = mail($to, $subject, $message, $headers);

    echo "<p>The following message was send successfully:</p><hr />";
    echo "<p>from: $from</p>";
    echo "<p>to: $to</p>";
    echo "<p>subject: $subject;</p>";
    echo "<p>message: $message</p>";


  echo "<p>the message was not send successfully!</p>";

  --Please give me some suggestion on how to configure my php.ini file
and mail client  so I can send email via php script. Thanks in advanced


Re: configure mail client to work with php.ini file?

apasj06 wrote:
Quoted text here. Click to load it


Are you sure you're changing the correct php.ini file?  What does  
phpinfo() tell you?

Also - does your smtp server require authorization?  If so, you'll have  
to authorize yourself before sending the mail.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Site Timeline