By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,712 Members | 1,430 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,712 IT Pros & Developers. It's quick & easy.

configure mail client to work with php.ini file?

P: n/a
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: imap.aol.com

server information: incoming mail: imap.aol.com / port: 143
outgoing mail: smtp.aol.com / 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 = smtp.aol.com
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

<?php
$from = "mike <na**@aol.com>";
$to = "na**@yahoo.com";

$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);

if($messageSend)
{
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>";

}

else
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

Jeff
11-5-06

Nov 6 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
apasj06 wrote:
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: imap.aol.com

server information: incoming mail: imap.aol.com / port: 143
outgoing mail: smtp.aol.com / 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 = smtp.aol.com
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

<?php
$from = "mike <na**@aol.com>";
$to = "na**@yahoo.com";

$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);

if($messageSend)
{
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>";

}

else
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

Jeff
11-5-06
Jeff,

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.
js*******@attglobal.net
==================
Nov 6 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.