Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
November 6, 2006, 8:59 pm
rate this thread
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
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
;SMTP = localhost
;smtp_port = 25
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
$to = "firstname.lastname@example.org";
$subject = "Agenda for tomorrow's metting";
$message ="In tomorrow's meeting, we will discuss our new marketing
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?
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
JDS Computer Training Corp.
- » http://www.phpnet.us/ - anyone had any experience?
- — Previous thread in » PHP Scripting Forum